home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 5
/
Gold Medal Software - Volume 5 (Gold Medal) (1995).iso
/
utils1
/
cfg241.arj
/
CFG.DOC
< prev
next >
Wrap
Text File
|
1994-12-28
|
169KB
|
4,470 lines
CFG Version 2.41
Special Enhancements (TM)
Mark Treadwell
4 Mumford Avenue Apt A
Newport, Rhode Island 02840-1719
CompuServe: 73700,3344
Prodigy: WNBH41A
Internet: 73700.3344@compuserve.com
Copyright 1992-1994 Mark Treadwell
All Rights Reserved
Contents
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . 3
1.1 Basic Operation . . . . . . . . . . . . . . . . . . . . 3
1.2 System Requirements . . . . . . . . . . . . . . . . . . 3
1.3 Disk Files Included with CFG . . . . . . . . . . . . . 3
1.4 Documentation . . . . . . . . . . . . . . . . . . . . . 4
1.5 Acknowledgements . . . . . . . . . . . . . . . . . . . 4
Chapter 2: Registration - Why and How . . . . . . . . . . . . . . 5
2.1 Definition of Shareware . . . . . . . . . . . . . . . . 5
2.2 Disclaimer - Agreement . . . . . . . . . . . . . . . . 5
2.3 What You Get . . . . . . . . . . . . . . . . . . . . . 6
2.4 How To Register . . . . . . . . . . . . . . . . . . . . 6
Chapter 3: Installation . . . . . . . . . . . . . . . . . . . . . 7
3.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Locations . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Quick Help . . . . . . . . . . . . . . . . . . . . . . 7
Chapter 4: To Use . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1 Command Line Syntax . . . . . . . . . . . . . . . . . . 8
4.2 Global Switches . . . . . . . . . . . . . . . . . . . . 8
4.3 Switch Usage . . . . . . . . . . . . . . . . . . . . . 9
4.4 MultiCommand Mode . . . . . . . . . . . . . . . . . . . 9
4.5 Number Base . . . . . . . . . . . . . . . . . . . . . . 10
4.6 Return ErrorLevel . . . . . . . . . . . . . . . . . . . 10
4.7 Messages . . . . . . . . . . . . . . . . . . . . . . . 10
4.8 Notes . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.8.1 Usage From CONFIG.SYS and the Command Line . . 11
4.8.2 On Loading High . . . . . . . . . . . . . . . . 11
4.8.3 Case on the Command Line . . . . . . . . . . . 11
4.8.4 DOS Environment . . . . . . . . . . . . . . . . 11
4.8.5 Undocumented DOS . . . . . . . . . . . . . . . 13
Chapter 5: Commands . . . . . . . . . . . . . . . . . . . . . . . 14
Appendix A: Problems and Solutions . . . . . . . . . . . . . . . 63
Appendix B: Bibliography . . . . . . . . . . . . . . . . . . . . 64
Appendix C: Revision History . . . . . . . . . . . . . . . . . . 65
Appendix D: Background Discussion . . . . . . . . . . . . . . . . 71
Appendix E: Error Messages . . . . . . . . . . . . . . . . . . . 73
Appendix F: Sample CONFIG.SYS File . . . . . . . . . . . . . . . 76
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Chapter 1: Introduction
Thank you for using CFG Version 2.41. CFG is a program that provides
multiple utilities for use during CONFIG.SYS device driver
installation and from the DOS command line and batch files. The
program does not remain resident and releases all memory on
termination. Suggestions for additions or modifications to CFG are
welcome.
I can be contacted via CompuServe Mail at 73700,3344. CompuServe Mail
may be accessed via the Internet using the address:
73700.3344@compuserve.com
I can be reached via Prodigy Mail at UserID WNBH41A.
I may also be contacted via surface mail at the address shown on the
title page.
I am an officer in the United States Navy. As such, I travel
frequently as a part of my job. I carry my portable computer and
access CompuServe when possible, so your inquiries can be answered
quickly. I currently have a job ashore and am readily accessible. I
should not be deployed overseas again until 1996 at the earliest.
1.1 Basic Operation__________________________________________________
CFG functions similar to many of the standard utilities included with
DOS. CFG depends on its command line being formatted in accordance
with the Syntax section below and any additional information given for
each command. CFG processes the command line from left to right and
each command is executed in order. Many commands return a DOS
ErrorLevel that can be used in a batch file. The Commands section
below provides detailed information on each command and its options.
1.2 System Requirements______________________________________________
CFG requires an IBM compatible computer with approximately 160
kilobytes of free low memory to run. Most commands require DOS
Version 3.0 or later. If a command requires a later version of DOS,
it is specifically noted in its description in the Commands section
below. The CFG screen browser will work with all standard video
display systems: MDA, CGA, EGA, VGA and SVGA.
1.3 Disk Files Included with CFG_____________________________________
CFG.COM - Main executable file
CFG.HLP - Short description help file
CFG.DOC - Main documentation and long description help file
CFG.REG - Shareware registration order form
CFG.NEW - Info on changes/bug fixes since the last version
INSTALL.BAT - Installation batch file for CFG
CFG.INS - INSTALL.BAT renamed in the installation directory
README.CFG - CFG readme file
FILE_ID.DIZ - Program ID file
1.4 Documentation____________________________________________________
This documentation is formatted for printing as a booklet with a
maximum of 65 lines per page. The Table of Contents and Index are
based on this length.
1.5 Acknowledgements_________________________________________________
CFG is written entirely in assembly language and compiled using the
Microsoft Macro Assembler Version 6.11a. There are no external code
libraries involved.
CFG was inspired by Michael Mefford's BatchMan utility. BatchMan only
works from batch files. Unfortunately, that is not quite what I
wanted...
My thanks to:
Ed Ruth for testing, suggestions and endurance Beyond the Call of Duty
Rod Pullman for his DEVICE.COM utility
Sande Nissen for her suggestions
... and the many others whose comments have helped make CFG a better
program
Chapter 2: Registration - Why and How
2.1 Definition of Shareware__________________________________________
Shareware distribution gives users a chance to try software before
buying it. If you try a Shareware program and continue using it, you
are expected to register. Individual programs differ on details --
some request registration while others require it, some specify a
maximum trial period. With registration, you get anything from the
simple right to continue using the software to an updated program with
printed manual.
Copyright laws apply to both Shareware and commercial software, and
the copyright holder retains all rights, with a few specific
exceptions as stated below. Shareware authors are accomplished
programmers, just like commercial authors, and the programs are of
comparable quality. The main difference is in the method of
distribution. The author specifically grants the right to copy and
distribute the software, either to all and sundry, or to a specific
group. For example, some authors require written permission before a
commercial disk vendor may copy their Shareware.
Shareware is a distribution method, not a type of software. You
should find software that suits your needs and pocketbook, whether
it's commercial or Shareware. The Shareware system makes fitting your
needs easier, because you can try before you buy. And because the
overhead is low, prices are low also. Shareware has the ultimate
money-back guarantee -- if you do not use the product, you do not pay
for it.
2.2 Disclaimer - Agreement___________________________________________
Users of CFG must accept this disclaimer of warranty: "CFG is supplied
as is. The author disclaims all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and
of fitness for any purpose. The author assumes no liability for
damages, direct or consequential, which may result from the use of
CFG."
CFG is a "shareware program" and is provided at no charge to the user
for evaluation. Feel free to share it with your friends, but please
do not give it away altered or as part of another system. The essence
of "user-supported" software is to provide personal computer users
with quality software without high prices, and yet to provide
incentive for programmers to continue to develop new products. If you
find this program useful and find that you are using CFG and continue
to use CFG after a reasonable trial period, you must make a
registration payment of $25 to Special Enhancements. The $25
registration fee will license one copy for use on any one computer at
any one time. There is a $5 shipping and handling fee for orders
outside the United States. You must treat this software just like a
book. An example is that this software may be used by any number of
people and may be freely moved from one computer location to another,
so long as there is no possibility of it being used at one location
while it's being used at another. Just as a book cannot be read by
two different persons at the same time.
Commercial users of CFG must register and pay for their copies of CFG
within 30 days of first use or their license is withdrawn.
Site-License arrangements may be made by contacting Special
Enhancements.
Anyone distributing CFG for any kind of remuneration must first
contact Special Enhancements at the address below for authorization.
This authorization will be automatically granted to distributors
recognized by the Association of Shareware Professionals (ASP) as
adhering to its guidelines for shareware distributors, and such
distributors may begin offering CFG immediately. (However Special
Enhancements must still be advised so that the distributor can be kept
up-to-date with the latest version of CFG.)
You are encouraged to pass a copy of CFG along to your friends for
evaluation. Please encourage them to register their copy if they find
that they can use it. All registered users receive a copy of the
latest version of CFG.
2.3 What You Get_____________________________________________________
The registration fee is paid once and gives you the right to use all
future versions. You get a disk and laser-printed user guide, and are
notified whenever a major revision is released. Upgrades are free for
the download, but I will ship a new disk and printed documentation for
$10 at your request. There is a $5 shipping and handling fee for
orders outside the United States. Just send a message via CompuServe
Mail, and I will ship the order and invoice.
2.4 How To Register__________________________________________________
There are two ways to register CFG. The file CFG.REG is an order
form. Please print and send the form with payment to:
Mark Treadwell
4 Mumford Avenue, Apt A
Newport, RI 02840-1719
Another way to register is via CompuServe's online SWREG service.
SWREG is a CompuServe service that easily allows you to register
Shareware. The price of the program is charged to your CompuServe
account. To register CFG through SWREG:
* Run your communications program to logon to CompuServe
interactively.
* Type "GO SWREG" [Enter] to get the SWREG menu and follow the
menus to register CFG. When prompted for the program
identification, type 3508, which is CFG's identification number.
You'll receive the CFG package in a few days. The program will
be on a double-sided, 3.5 inch diskette. If you prefer a 5.25
inch diskette, just send me a note via CompuServe Mail
[73700,3344].
If you have any enhancements, problems, suggestions, comments or
complaints, please send them to me via CompuServe Mail or a written
letter to the above address. Even if you have not decided to keep
CFG, feel free to get in touch with me. I will reply within 48 hours.
Send to Mark Treadwell 73700,3344.
Chapter 3: Installation
3.1 Procedure________________________________________________________
Installation is very easy. Extract the files from the compressed
archive into the desired disk subdirectory. Alternately, extract them
onto a floppy disk and run the included INSTALL.BAT file. The
necessary files will be copied to the drive and directory you specify.
I recommend installing to your DOS directory or a general utility
directory that is specified in your DOS PATH statement.
3.2 Locations________________________________________________________
The absolute minimum files for full operation are CFG.COM, CFG.HLP and
CFG.DOC. CFG.COM expects to find CFG.HLP and CFG.DOC in the same
directory that it was executed from. If you do not execute a help
command, only CFG.COM itself is required. If the installation
directory is specified in your DOS PATH, you are not required to
specify the full drive and directory when executing CFG.
3.3 Quick Help_______________________________________________________
"CFG /?" gets you a syntax description and a summary of commands in a
scrollable window. "CFG Help CommandName" gets you this file opened
to the appropriate CommandName entry in a scrollable window.
Chapter 4: To Use
4.1 Command Line Syntax______________________________________________
From CONFIG.SYS:
DEVICE=[d:][path]Cfg.Com CommandName [Options] [;CommandName
[Options] [; ... ]]
From the DOS command line or batch file:
[d:][path]Cfg CommandName [Options] [;CommandName [Options]
[; ... ]]
Parameters:
[d:][path]
Specifies the location of the CFG.COM file.
CommandName
The valid CommandNames are given below. The CommandNames must
be fully spelled out exactly as shown.
[Options]
CommandName related options and SubCommandNames are detailed
below for each command.
4.2 Global Switches__________________________________________________
/Bn Base switch. You may select the desired number system
base to use. Some commands specifically require decimal
or hexadecimal input. The default number system is base
10. The "n" specifies the decimal number representing the
new number base. Valid values for "n" are 2, 8, 10 and
16. (Example: /B16)
/Dn Divisor switch. You may select an optional block size for
ErrorLevel reporting of commands. The default block size
is 1 unless a different default is given in the specific
command section. This allows returning a valid ErrorLevel
for a value that is greater than 255. The "n" specifies
the decimal number by which the result is divided. Valid
values for "n" range from 1 to 65535. (Example: /D8192)
/E[+] Display the exit ErrorLevel. The "+" option will display
[@] extended ErrorLevel information including the command and
[!] subcommand being executed. The "@" option places the
[E] output ErrorLevel in the environment variable "EL". By
default, this will be in the master environment. Use the
/2 switch to place it in the environment of a secondary
command processor. Use the "!" option to specify which of
the possible ErrorLevels to return in MultiCommand. Use
the "E" option with "@" if you want the basic ErrorLevel
displayed with environment output. The order of the
options does not matter.
/Q Quiet switch. Commands will not display character output
if this is used. This switch may be used with the /@EnVar
switch, but has no effect on the /E and /E+ switch output
or error output.
/1[A|B] Use the primary or master environment. This is the
default and overrides the /2 switch. See the CFG.ADD file
for an explanation of the "A" and "B" options for this
switch.
/2 Use the secondary or parent environment.
/@[=]EnVar Environment output switch. Place ASCII result in the DOS
environment variable "EnVar". No spaces are allowed
between the "@", the "=" (if used) and the environment
variable name. The rules for environment variables are
the same as for the DOS SET command except that mixed case
is permitted for the variable name by default. The "="
option forces CFG to capitalize "EnVar" to ensure
compatibility with the DOS SET command. See the DOS
Environment section in the CFG.ADD file for further
details. Each command that supports this switch is
indicated below. The variable name should be followed by
at least one space to prevent following command line text
from being included in the name.
/, Insert commas every three places in decimal numbers
displayed on the screen.
/? Display an abbreviated command summary. Available from
command line only. Not available in MultiCommand mode.
See the individual commands for additional switches.
4.3 Switch Usage_____________________________________________________
The command line is scanned for any switches before CommandName
parsing. If a valid switch is found, a program variable is set and
the switch is blanked from the command line by replacing it with
spaces. This includes text and numbers appearing after the /@, /B, /D
and /E switches. A switch may be placed anywhere on the command line
and still be found. Switches will not be found in *quoted* text
strings (such as in Cecho, Echo and EchoPause) as long as there are
closing quotes. Note that *all* possible switches are scanned for
each command since CFG does not know the CommandName when switch
parsing occurs.
If you use the MultiCommand syntax, the switches are scanned only
between the MultiCommand separators. This allows each individual
command on the command line to have its own different set of switches.
If the /1 and /2 switches are both used, CFG will update both the
master and parent environments. If the two refer to the same segment,
CFG will only update it once. If both are used with an Env command
information subcommand, master environment data is returned. See the
DOS Environment section of the CFG.ADD file for the gory details. If
the switches are used by themselves, only the designated environment
is updated.
4.4 MultiCommand Mode________________________________________________
CFG's MultiCommand mode allows more than one CommandName on the
command line. The standard separator between commands is the semi-
colon. CFG treats each section in MultiCommand mode completely
independent of any other. All switches and variables are reset, but
environment changes are cumulative. It is just like running the program again. See the Sample CONFIG.SYS section of the CFG.ADD file
for examples. Help is not available in MultiCommand mode.
Be aware that DOS will strip semi-colons from passed parameters (%1,
%2, etc.) in a batch file if that is how you build CFG's command line.
DOS does this because it treats a semi-colon as white space.
4.5 Number Base______________________________________________________
The /Bn switch allows you to specify the number base used by CFG. All
subsequent number input and output is with the specified base. If the
value of "n" is not 2, 8, 10 or 16, the switch is ignored with an
error message. In this case, the default base 10 is used. The
command must specifically support this switch for it to be in effect.
4.6 Return ErrorLevel________________________________________________
Generally, the exit ErrorLevel is 0 for off/invalid/disabled/etc. and
1 for on/valid/enabled/etc. Specific values are given for each
command. An ErrorLevel of 255 generally indicates that an error
occurred. Commands with no particular exit ErrorLevel will always
return 0. A decimal output of the number may be placed in the
environment if the /E@ switch is used.
To amplify the Global Switches description above: /E displays the
basic ErrorLevel as a decimal number. /E+ displays the ErrorLevel
with the CommandName and SubCommandName. /E@ places the ErrorLevel in
the environment variable "EL". /E@ will not display the basic
ErrorLevel. Use /EE@ (or /E@E) to display the basic ErrorLevel with
environment output. The "+" option overrides the "E" option if both
are used. A "!" may be used in conjunction with any or all of these
to tell CFG which ErrorLevel of a MultiCommand command line to return.
Clear as mud?
4.7 Messages_________________________________________________________
CFG's messages contain the following elements:
- CFG's name
- CFG's version
- CommandName
- SubCommandName (if applicable)
- Command number (in MultiCommand mode)
- Error warning (if an error occurred)
- Message text
- ErrorLevel (for error messages)
CFG provides numerous error messages to make problems easier to
diagnose and correct. This is useful in CONFIG.SYS since rebooting
multiple times to get things right can be tedious. ErrorLevel
reporting is available from both CONFIG.SYS and the command line
although it can only be acted on from a batch file.
4.8 Notes____________________________________________________________
The following are general notes on program operation.
4.8.1 Usage From CONFIG.SYS and the Command Line_____________________
CFG is a dual mode program that will run both as a non-resident device
driver from CONFIG.SYS and as a command line/batch file utility. The
title line of each command below specifies whether it can be used from
CONFIG.SYS, from a BATCH file (command line) or from both.
4.8.2 On Loading High________________________________________________
CFG should *NOT* be loaded high while executing. Doing so with third
party programs may actually waste memory since stubs of the loader
programs may remain resident in low memory. Also, CFG requires 130 KB
of memory to run for some commands. If CFG is not placed in a UMB of
requisite size, memory errors will occur. Play it safe and run CFG
low.
4.8.3 Case on the Command Line_______________________________________
Case does not matter in CONFIG.SYS since DOS capitalizes everything in
the file during its parsing scans. This shift to all upper case is
pertinent when using the Cecho, Echo or EchoPause commands in
CONFIG.SYS.
CFG does the same shift internally when parsing the command line, so
you may use any mixture of case you desire on the CFG input line.
4.8.4 DOS Environment________________________________________________
The DOS command interpreter COMMAND.COM maintains an area of memory
called the environment in which it stores specially formatted
information that is globally available to all programs and batch
files. The environment block contains a list of ASCIIZ strings
(strings of ASCII characters, each terminated by a zero byte) that
store various information. You may view the contents of the
environment by typing "SET" at the command line prompt.
The DOS environment size for the resident command processor is
specified with the SHELL command in CONFIG.SYS. The COMMAND.COM
/E:nnnnn switch specifies the environment size, where "nnnnn" must be
in the range 160 through 32768. DOS rounds this number up to a
multiple of 16 bytes. If "nnnnn" is less than 160 or greater than
32768, DOS uses the default size of 256 bytes and displays a
"Parameter value not in allowed range" error (actually just a
warning). The environment size can only be changed by editing
CONFIG.SYS and rebooting the system. See the "Sample CONFIG.SYS"
section below for an example SHELL line.
Each environment string is of the form "NAME=value", where NAME is
capitalized and may be of reasonable length and "value" can be almost
anything. The only thing that cannot be in an environment string is
an equals sign (since it separates the NAME and "value") and a zero
byte (since it is the string terminator). The environment is
accessible via the DOS SET command. DOS automatically capitalizes all
NAME variables. The CFG Env Set command and /@EnVar switch will allow
you to specify exactly the case of the NAME. See below how you can
change this behavior. Environment variables with lower case letters
may be displayed by the DOS SET command, but they cannot be changed.
Each program receives a copy of the DOS environment for its local use
on execution. The size of this local environment is always rounded up
to the next largest number divisible by 16 based on the total length
of strings currently in the environment. This is due to the way DOS
allocates blocks of memory in paragraph (16 byte) amounts. This
leaves little or no room for further expansion and storage.
CFG manipulates the DOS environment(s) directly. I normally dislike
doing stuff like this, but it ended up being just too useful an
ability to pass up. CFG output is much easier to use by stuffing it
into the environment and allowing DOS to do the string manipulations
and concatenations. Note that a batch file line that invokes
environment variables will be processed by DOS using the active
environment---CFG will never know environment variables were involved
(and for my sanity, I do not want to know!).
Note that DOS will automatically extend the size of the active
environment if it is adjacent to a free memory block and environment
variables are entered from the command line. As soon as a batch file
or a program is loaded into memory, the size of the environment is
constrained. In the case of a secondary command processor, it will be
cut off at the start of the next paragraph of memory. This is what
causes the environment of a secondary command processor to only have
between 0 and 15 bytes of free space.
There are several methods to locate the master environment. The pros
and cons of each method are discussed in detail in Andrew Schulman's
(et al) excellent book _Undocumented_DOS_ (Second Edition) [highly
recommended!]. I refer you there for the detailed discussion.
Suffice it to say that the first method I used to locate the
environment was to walk the chain of Memory Control Blocks to locate
COMMAND.COM. I had a problem with assumptions when I ran into 386^Max
version 7 and its DOSMAX utility, which can load the COMMAND.COM stub
into an UMB. I (and others) had never expected this (silly us), so
the routine failed. I fixed this by linking in the UMB memory chain.
This, however, assumes that the memory manager involved supports the
standard DOS UMB link and strategy commands. Due to the possibility
of faking this test out, it is now the secondary option available via
the /1B switch. The new default method is via the DOS Interrupt 1EH
vector. This method is available via the /1 or /1A switch. Normally,
you need just specify /1 on the command line for the master
environment. Neither /1 or /2 is required unless you need to specify
the specific environment.
As a side note to all of this, PC Magazine published a Debug script in
their January 25, 1994 issue that created UMB.COM. This small utility
changed the DOS memory strategy at the end of CONFIG.SYS execution so
that the UMB area was the preferred load location when COMMAND.COM was
being installed. As you may expect, the master environment followed
it into a UMB and CFG had a problem again. This one is also fixed by
the changes noted above.
Several people asked to change the default CFG uses for /@EnVar to
always capitalizing the "EnVar". I resist this simply because there
may be systems that depend on that behavior. Changing the default
would change the way batch files are processed. I added the "="
option to /@ to give CFG this ability without changing the default.
Since "=" cannot be in an environment name, it is perfect for this
application.
4.8.5 Undocumented DOS_______________________________________________
An unfortunate fact of life is that documentation is often terrible.
[This does not apply to me since I try to believe that my
documentation is superb. <VBG>]
One of the things the Microsoft does not document, but many people
use, is a special DOS data area. The data area goes by several
popular names: List of Lists, SysVars, SysInitVars. Whatever you
call it, DOS cannot exist without this group of variables. Neither
can CFG. I note in each section of this file if the particular
command uses undocumented information. In most cases, this use of
undocumented DOS starts with that special DOS data area. This is a
relatively minor use of undocumented DOS, as such things go, but I
feel compelled to admit its use since I am providing a general utility
program that is intended to be reliable under all versions of MS-DOS.
[Note that I say MS-DOS. Please do not hold me responsible for
DR/Novell DOS or 4DOS/NDOS.]
I must acknowledge Andrew Schulman as the master of undocumented DOS.
That said, I recommend his Undocumented DOS, Second Edition as a basic
source for an explanation of undocumented DOS calls. There are
several other texts that also pertain. These are listed in the
bibliography. I heartily recommend all of them as a basic reference
library if you are trying to program for DOS. You can certainly
accomplish much using only documented functions, but the use of
undocumented functions and data structures is the only way to
accomplish some tasks. Witness some of the functions that CFG
provides.
If you have any undocumented DOS questions, I will be happy to answer
them. Alternatively, I recommend the "Undocumented Corner" (Section
4) of the Doctor Dobbs Journal Forum on CompuServe (GO CIS:DDJFORUM)
as the ultimate source. Andrew Schulman, Jim Kyle, Geoff Chappell,
Max Pietrek and many other notables of undocumented programming hang
out there (I lurk, I do not consider myself such a notable).
Chapter 5: Commands
The commands below are generally in alphabetical order except for
those which are closely related by function. The leading "▒▒▒" for
each command is required for the search engine in the CFG Help
command.
All command line formats and examples given below should be understood
to begin with "Device=[d:][path]Cfg.Com " in the CONFIG.SYS file or
"[d:][path]Cfg " from the command line unless specified otherwise.
▒▒▒Add ▒▒▒Sub ▒▒▒Mul ▒▒▒Div ▒▒▒Mod ▒▒▒And ▒▒▒Or ▒▒▒Xor ▒▒▒Not [BATCH]
Perform various arithmetic operations on the arguments.
Command line format:
Add [/@EnVar] [/Q] [/Bn] a b c ...
Sub [/@EnVar] [/Q] [/Bn] a b c ...
Mul [/@EnVar] [/Q] [/Bn] a b c ...
Div [/@EnVar] [/Q] [/Bn] a b
Mod [/@EnVar] [/Q] [/Bn] a b
And [/@EnVar] [/Q] [/Bn] a b
Or [/@EnVar] [/Q] [/Bn] a b
Xor [/@EnVar] [/Q] [/Bn] a b
Not [/@EnVar] [/Q] [/Bn] a
CFG performs internal 64-bit arithmetic and returns a 32-bit result.
With this accuracy, the largest number CFG can handle is 2^^32-1, or
4,294,967,295. This should be adequate for most purposes. CFG
performs unsigned operations so all values must be positive. All
commands support the /Bn Base switch. Also see the Convert command
for converting numbers between number bases.
Add - Sums the numbers on the command line. An overflow error is
generated if the result exceeds the 32-bit limit given above.
Sub - Subtracts the number "b", "c", etc. from "a". An underflow
error is generated if the result goes negative.
Mul - Multiplies the numbers on the command line. An overflow error
is generated if the result exceeds the 32-bit limit given above.
Div - Divides "a" by "b" and returns the quotient. A divide by zero
error is generated if the divisor "b" is zero.
Mod - Divides "a" by "b" and returns the remainder. A divide by zero
error is generated if the divisor "b" is zero.
And - Performs a bitwise AND of "a" and "b".
Or - Performs a bitwise OR of "a" and "b".
Xor - Performs a bitwise exclusive OR of "a" and "b".
Not - Takes the inverse of "a".
▒▒▒ANSI . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Determine if the ANSI driver is loaded in memory.
Command line format:
ANSI
Exit ErrorLevels:
0 = ANSI is not installed
1 = ANSI is installed
Determines if any ANSI driver is installed by writing an ANSI cursor
positioning string to the screen.
▒▒▒ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Read input numbers and write the corresponding ASCII characters.
Command line format:
ASCII [/Bn] a b c ...
where "a b c ..." represent numbers. The command reads the numbers
and writes the corresponding ASCII characters to DOS StdOut, allowing
the output to be redirected as desired. This is a very useful way of
creating short temporary files or sending printer control characters.
The quantity of input numbers is limited only by DOS command line
length. The /Bn Base switch specifies the number base to be used for
command line numbers. The /Q switch has no affect on this command.
Numbers greater than 255 are ignored.
Example command use:
Cfg RandomFile /@RETURN %TEMP%
Cfg ASCII 64 67 68 32 > %TEMP%\%RETURN%.BAT
CD >> %TEMP%\%RETURN%.BAT
This example creates a unique random file name in the system TEMP
directory, writes "@CD " to the temporary batch file and adds the
current directory. Executing %TEMP%\%RETURN%.BAT will return you to
the current directory.
▒▒▒Beep . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Beep the speaker.
Command line format:
Beep [m n [, m n] ... ] [/Bn] [/N]
where "m" corresponds to a frequency in Hertz and "n" corresponds to
the number of 1/18 second increments that comprise the duration. The
/N switch tells CFG to not flush the keyboard buffer prior to
executing the command. If nothing is specified, the default sound is
a C note for 1/6 of a second (1046,3). By separating the argument
pairs with commas, a series of tones may be produced with the same
command. Pressing any key while playing ends the command. Commas are
strictly interpreted as separators.
▒▒▒Blink . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Enable blinking screen characters.
Command line format:
Blink
Calls Interrupt 10H Function 10H Subfunction 3 to enable blinking
characters on EGA and above. Any characters with intense backgrounds
will start blinking.
▒▒▒Boot . . . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG]
Modify CONFIG.SYS in memory during execution.
Command line format:
Boot SubCommandName
NOTE: Uses undocumented information.
The following are valid SubCommandNames: NoError. Each SubCommandName
may be abbreviated as desired. Error messages are displayed if the
routine fails.
NoError: Scans the tokenized CONFIG.SYS file in memory and changes
any lines which will display an "Unknown command" error to a Remark.
This effectively hides errors from the DOS parser. This option
currently works under DOS version 5.0 only.
Additional SubCommands are under development.
The NoError option will report the number of errors which it cleared.
It is important to note that this only works on DEVICE statements in
CONFIG.SYS since general parameters (such as FILES, BUFFERS or SHELL)
are evaluated prior to loading device drivers.
▒▒▒Border . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set the screen border color.
Command line format:
Border [Color]
The notes on colors for the Cls command apply to the Border command
except as noted here.
If no color is given or an invalid color is specified, the current
screen background color at the cursor location is used. If anything
appears after the CommandName that cannot be parsed as a color, an
error message is displayed.
▒▒▒Break . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine status of DOS extended Break checking.
Command line format:
Break
Exit ErrorLevels:
0 = Break is off
1 = Break is on
▒▒▒CanCopy . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if there is enough room to copy files to a disk.
Command line format:
CanCopy FileSpec [d:]
Exit ErrorLevels:
0 = No room to copy files or DOS file error
1 = Room to copy files
where FileSpec can use any DOS wildcards and "d:" corresponds to a
valid DOS drive. If "d:" is omitted, the default drive is used. The
FileSpec search is not recursive. It will examine only the directory
specified.
▒▒▒Cecho . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Echo text to the screen with the specified colors.
Command line format:
Cecho [/I|/K] [/C|/N] "Fore [on] Back" String
The desired screen color for String must be enclosed in double quotes.
The notes for the Cls command use of colors apply. The /C switch is
used to output a carriage return only at the end of the String,
returning the cursor to the first column for overwriting the previous
output. The /I switch calls the Intense command to enable intense
backgrounds on EGA and above. The /K switch calls the Blink command
to enable blinking characters on EGA and above. The /N switch is used
to eliminate the final carriage return/line feed, leaving the cursor
at the end of the String just displayed. /I takes precedence over /K
and /N takes precedence over /C if all are included.
The displayed String starts with the first character after the closing
double quote of the color, leading spaces are included. The Echo
command line format applies to the String. The /Q switch has no
affect on this command.
▒▒▒Cls . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Clear the screen with a choice of foreground and background colors.
Command line format:
Cls [Foreground [on] Background]
The following colors may be used:
- Black - Grey
- Blue - Bright Blue
- Green - Bright Green
- Cyan - Bright Cyan
- Red - Bright Red
- Magenta - Bright Magenta
- Yellow - Bright Yellow
- White - Bright White
If any bright color in the right column is chosen for a background,
the video display is reprogrammed to show intense background colors
vice blinking text. Programs may reset this, causing all text on the
screen to start blinking.
If ANSI is not installed, the screen is cleared using a BIOS window
scroll. The screen colors may not remain permanent depending on the
behavior of the video adapter. If ANSI is installed before CFG is
run, CFG will detect it and use ANSI escape sequences to change system
colors.
If no colors a given or if an invalid combination is used, the current
screen colors at the cursor location are used. If anything appears
after the CommandName that cannot be parsed as a color, an error
message is displayed with a three second WaitFor pause prior to
continuing with the clear screen.
Cls sets the screen border (overscan register) to the same color as
the background. Use the Border command if you want to change this.
It also restores the cursor size to what it was initially since some
ANSI clear screen routines change the cursor size.
NOTE: The "Bright ..." colors are scanned on the command line with
only a single space between the words. This was done to simplify the
parsing routine. Otherwise, CFG will accept any number of spaces
between words.
▒▒▒CodePage . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the current system code page table.
Command line format:
CodePage [/Q] [/@EnVar]
Exit ErrorLevels:
0 = Code Page 437 [English-United States]
1 = Code Page 850 [Multilingual (Latin I)]
2 = Code Page 852 [Slavic (Latin II)]
3 = Code Page 860 [Portugal]
4 = Code Page 861 [Iceland]
5 = Code Page 863 [French Canadian]
6 = Code Page 865 [Norway/Denmark]
254 = Unknown Code Page
255 = Invalid DOS version
The code page number is displayed. This command requires DOS version
3.3 or higher.
▒▒▒ColdBoot . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Perform equivalent of a power-on system reset.
Command line format:
ColdBoot SubCommandName [/V]
The following are valid SubCommandNames: WaitFor, WaitTo, Verify.
Each SubCommandName may be abbreviated as desired. Error messages are
displayed if the routine fails. All disk buffers that may not yet be
written are flushed to disk via Interrupt 21H Function 0DH (Disk
Reset) prior to system reset. For 8086/8088 processors only, the
command jumps to FFFF:0000 after clearing the warm boot flag in the
BIOS data area. For 80286+ processors, the system is reset via the
keyboard controller. The /V Verify switch is available for use with
the WaitFor and WaitTo subcommands.
WaitFor: Executes the WaitFor command first. All command line
options of the WaitFor command are available.
WaitTo: Executes the WaitTo command first. All command line options
of the WaitTo command are available.
Verify: Prompt before rebooting.
▒▒▒Color . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set the screen color for future output using ANSI escape sequences
without clearing the screen.
Command line format:
Color Foreground [on] Background
The notes on colors for the Cls command apply to the Color command
except as noted here.
ANSI must be installed. If it is not installed, the command is
aborted with an error message. If no colors are given or if an
invalid combination is used, an error message is displayed.
The Color command is designed to be used immediately after ANSI has
been loaded into memory to set its default colors from white on black
to what you desire. It may also be used to highlight the output of a
specific program or group of programs that do not use the BIOS for
output. Note that Color will not repaint the screen. It only sets
the color of any future output made via DOS. Use the Cls command to
reset the entire screen.
▒▒▒Cols . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the number of displayed columns.
Command line format:
Cols
The returned ErrorLevel is based on the value stored in the BIOS data
area.
▒▒▒ComBaud . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Returns the baud rate of the indicated serial port.
Command line format:
ComBaud n [/Q] [/@EnVar]
Exit ErrorLevels:
0 = Error 7 = 4800 baud
1 = 110 baud 8 = 9600 baud
2 = 150 baud 9 = 14,400 baud
3 = 300 baud 10 = 19,200 baud
4 = 600 baud 11 = 38,400 baud
5 = 1200 baud 12 = 57,600 baud
6 = 2400 baud 13 = 115,200 baud
where "n" is the serial port to be tested. Valid numbers are 1, 2, 3
and 4. An error message is given if the port is missing or invalid.
The exact baud rate is displayed. An intermediate rate will return
the ErrorLevel of the faster rate.
▒▒▒ComHide . . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG]
Hide and restore the serial port base addresses.
Command line format:
ComHide SubCommandName
The following are valid SubCommandNames: Hide, Restore. Each
SubCommandName may be abbreviated as desired. Error messages are
displayed if the routine fails.
ComHide hides the serial port base addresses by copying them to
another location in memory when the Hide option is used. On
restoration with the Restore option, ComHide verifies the signature
and checksum stored with the port addresses to ensure that they were
not accidently over-written while hidden. ComHide then copies the
base addresses back to their normal location.
The default location for the hidden data is 7001:0000 for DOS versions
before 5.0. This is below the 512 KB boundary in the event that the
machine only has that much base memory available, and high enough to
keep it from being over-written during execution of other device
drivers while the data is hidden. For DOS Version 5.0+, the location
will vary depending on what the SysInit loader module reports as the
maximum available memory in the device driver header. This prevents
interference with the larger memory requirements in the upper areas
around the 640 KB point that can occur under DOS 6.0+ with large
multiple-configuration CONFIG.SYS files.
Example command lines:
CFG.COM ComHide Hide
MANGLE.SYS
CFG.COM ComHide Restore
▒▒▒Compare . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Compare two strings.
Command line format:
Compare [/C] String1 String2
Exit ErrorLevels:
0 = Strings are not the same
1 = Strings are the same
String1 and String2 must be a single group of characters, containing
no separators. The comparison is case sensitive. The /C switch makes
the comparison case insensitive.
▒▒▒ComSet . . . . . . . . . . . . . . . . . . . . . . [BATCH/CONFIG]
Sets the serial port base addresses to a default or specified value.
Command line format:
ComSet a [b]
Where "a" corresponds to the desired port base address to set: 1, 2, 3
or 4. The "b" corresponds to an optional hexadecimal value to set the
port base address to. No checking is performed to warn of values
being overwritten. Use this command carefully.
This command places a default port base address value (or the
specified value) in the appropriate location in the low memory DOS
data area. The default values used for the ports are 3F8H, 2F8H, 3E8H
and 2E8H. If your system uses different values, you must specify them
as "b" on the command line.
You can set multiple base addresses to the same value to access the
same physical port using different DOS port names. Note that this
command does not address any changes with the IRQ associated with a
specific port.
▒▒▒ComSwap . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Swap the serial base port addresses for the two serial ports
specified.
Command line format:
ComSwap a b
where "a" and "b" are the numbers of the serial ports to be swapped.
Valid numbers are 1, 2, 3 and 4. An error message is given if one of
the ports is missing or invalid.
ComSwap switches the two ports as far as DOS is concerned. This is
useful if you need to shift the port addresses around prior to loading
software device drivers. This command may not have any effect for
programs that use hard-coded port addresses. This command can not
shift hardware IRQ values. The contents of the port addresses are not
checked during the swap.
Example command line:
ComSwap 4 2
▒▒▒Convert . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Changes numbers between number base systems.
Command line format:
Convert a b [/Bn]
where "a" is in the base specified by the /Bn switch (or the default
decimal system) and "b" is a decimal number specifying the base to
convert "a" to.
▒▒▒CoProc . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the Intel CoProcessor installed.
Command line format:
CoProc [/Q]
Exit ErrorLevels:
0 = No coprocessor installed
1 = 8087
2 = 80287
3 = 80387DX or 80387SX
4 = 80486DX or 80487SX
5 = Pentium
This routine uses the Intel recommended techniques for properly
determining what type of coprocessor is installed in the system.
Use the CPU command to determine which processor is present.
▒▒▒Country . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the country code or return country specific information.
Command line format:
Country [n] [/Q] [/@EnVar]
where "n", if present, is a decimal value between 0 and 9 that returns
the following information:
n ErrorLevel String Description
──── ────────── ──────────────────── ─────────────────────────────
None ? Decimal number Country code
0 0 Decimal number Date: USA, mm dd yy
1 Decimal number : Europe, dd mm yy
2 Decimal number : Japan, yy mm dd
1 0 Currency symbol
2 0 Thousands separator
3 0 Decimal separator
4 0 Date separator
5 0 Time separator
6 0 Decimal number Currency: Symbol before value
1 Decimal number : Symbol follows value
2 Decimal number : Symbol replaces
decimal point
7 ? Decimal number Digits after currency decimal
8 0 Decimal number Time: 12-hour clock
1 Decimal number : 24-hour clock
9 0 Data-list separator
The "n" values 1, 2, 3, 4, 5 and 9 are also valid for the Now command
to include in its output. See the Now command for use.
▒▒▒CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the Intel Microprocessor installed.
Command line format:
CPU
Exit ErrorLevels:
0 = 8086/8088
1 = 80286
2 = 80386DX or 80386SX
3 = 80486SX
4 = 80486DX or 80487SX
5 = Pentium
This routine uses the Intel recommended techniques for properly
determining what type of CPU is installed in the system. If an 486
class microprocessor has been recognized, CFG will determine if the
CPU has a floating point unit (486 DX CPU, 487 SX MCP) or not (486 SX
CPU). For Pentium processors, the vendor identification returned by
the chip is displayed. For Intel Pentium processors, the step level,
model and family numbers are also displayed.
Use the CoProc command to determine which math coprocessor is present.
▒▒▒Cursor . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Change the size of the text mode screen cursor.
Command line format:
Cursor {SubCommandName|a b}
where "a" and "b" are decimal numbers of the start and stop screen
scan lines for the cursor. The following are valid SubCommandNames:
Default, Hide, Restore. Each SubCommandName may be abbreviated as
desired. If the routine fails, error messages are displayed and the
cursor size is not changed.
Default: Returns the cursor to the default values given below.
Hide: Sets the "invisible" bit code using Interrupt 10H Function 1.
Restore: Sets the "normal" bit code. Some programs may modify this
on their own. There are known bugs in these functions in some EGA
BIOS 43 line modes.
The start and stop scan lines are numbered with line 1 at the bottom
and increasing towards the top. Using this convention, the following
cursor values apply:
│ 25 line │ 43/50 line │
Adapter │ Default │ Default │ Maximum
────────┼─────────┼────────────┼────────
CGA │ 1 2 │ --- │ 8
EGA │ 2 3 │ 2 2 │ 14
VGA+ │ 2 3 │ 2 2 │ 16
This numbering scheme is a little more consistent than what the BIOS
expects and lets the program calculate the values required by the
BIOS. If a number greater than the maximum number of scan lines is
entered, it is truncated to the maximum.
Note that after a mode reset the cursor will be returned to its
default size by the BIOS. You will need to issue the appropriate
command to set it to the desired shape.
Video adapter BIOS' implement the cursor functions differently. You
may not get the results you expect when you specify scan lines,
depending on your adapter. Keep trying until you end up with a shape
you like.
Example command lines:
Cursor Hide
Cursor 2 2
▒▒▒Day ▒▒▒WeekDay ▒▒▒Month ▒▒▒Year ▒▒▒FullYear . . . . . . . [BATCH]
▒▒▒Hour ▒▒▒Minute ▒▒▒Second ▒▒▒AM ▒▒▒PM
Determine the return value for the appropriate command.
Command line format consists of the CommandName. Valid CommandNames
and the range of their return ErrorLevels are:
WeekDay . . . . . 0-6 *
Day . . . . . . . 1-31 *
Month . . . . . . 1-12 *
Year . . . . . . . 0-119
FullYear . . . . . 0-99
Hour . . . . . . . 0-23 *
Minute . . . . . . 0-59 *
Second . . . . . . 0-59
AM . . . . . . . . 0-1
PM . . . . . . . . 0-1
For WeekDay, an ErrorLevel of 0 corresponds to Sunday. For Year, the
ErrorLevel corresponds to the number of years since 1980. FullYear
gives the last two digits of the current year. For AM and PM, an
ErrorLevel of 1 is True, 0 is False.
The commands with an asterisk also accept a single decimal number
after the CommandName and compare it to the ErrorLevel that would be
generated for the standard command. If the values are equal, the
return ErrorLevel is 1, otherwise it is 0. This allows comparisons to
be done by CFG vice using convoluted If ErrorLevel batch file
structures.
▒▒▒DESQview . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if Quarterdeck's DESQview is running.
Command line format:
DESQview
Exit ErrorLevels:
0 = DESQview is not running
Else = DESQview version [(32*major)+minor]
Version 1.x identifies itself as version 1.0.
▒▒▒Device . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Determine if the specified device driver is resident in memory, rename
it or display a list of installed drivers.
Command line format:
Device SubCommandName {Options}
Exit ErrorLevels for Exist SubCommand:
0 = Not installed (also format error)
1 = Installed
Exit ErrorLevels for Rename SubCommand:
0 = Not renamed (also format error)
1 = Renamed
NOTE: Uses undocumented information.
The following are valid SubCommandNames: Exist, List, Rename. Each
SubCommandName may be abbreviated as desired. An error message is
displayed if there is a format error.
Exist DeviceName: This command scans the linked list of device
drivers and checks if the requested DeviceName is in the chain. It is
important to note that this command searches for the *DOS* driver
name, not the name of the file on disk. For example, SmartDrive's
driver name is SMARTAAR, EMM386's is EMMXXXX0 and Symantec's Ncache2
is @CACHE-X. Some drivers hook in multiple driver headers and names
for compatibility (Ncache2 also hooks SMARTAAR into the chain).
List: The DOS names of the installed device drivers are displayed.
*All* device names are displayed, including block devices which often
contain garbage, but sometimes have a name in their last seven places.
Characters below ASCII 032 are replaced with ASCII 176 ("░") for
display purposes.
Rename DeviceName1 DeviceName2: DeviceName1 is changed to
DeviceName2. An error is displayed if the DeviceName1 is not found,
the DeviceName2 is omitted or if DeviceName2 is longer than eight
characters. Use this function with care since system operation my
change as a result.
▒▒▒Dir . . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Get the current drive and directory.
Command line format:
Dir [/Q] [/@EnVar] [Path]
Exit ErrorLevels:
0 = Successful
Else = DOS error number
The resultant directory path includes the current drive. A final "\"
is not appended. If anything is included on the command line, it is
assumed to be a request for a canonicalized name of the supplied Path.
The input path need not actually exist. If the Path is on a JOINed
drive, the returned name is the one that would be needed if the drive
were not JOINed; similarly for a SUBSTed, ASSIGNed or network drive
letter. For this reason, it is possible to get a qualified name that
is not legal under the current combination of SUBSTs, ASSIGNs, JOINs
and network redirections.
If the requested Path starts with ".." or ".", they are resolved to
the parent directory and current directory, including drive letter,
using DOS Function 60H. See the FileDir command for extracting the
directory path from a supplied file name.
▒▒▒DirExist . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the requested directory exists on disk.
Command line format:
DirExist [d:][path]DirectoryName
Exit ErrorLevels:
0 = Directory does not exist
1 = Directory exists
▒▒▒Display . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the display combination code.
Command line format:
Display
Exit ErrorLevels:
1 = MDA
2 = CGA
4 = EGA color
5 = EGA mono
6 = PGS
7 = VGA mono
8 = VGA color
11 = MCGA mono
12 = MCGA color
▒▒▒DosKey . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the DOSKEY command line editing and recall program is
installed or input/retrieve previous command lines.
Command line format:
DosKey [/I] [/M] [/@EnVar]
Exit ErrorLevels for /I:
0 = Not installed or invalid DOS version
1 = Installed
The /I Installation switch overrides all others. All previous command
line entries are accessible via the cursor keys. All of the normal
DOS editing keys available with DOSKEY installed are accessible via
this command except for F7 Redisplay Commands.
DOSKEY macros are available via this command. See the CFG.ADD file
for the nuances of DOSKEY's operation with regards to macros and this
command. If a macro name or a command with DOSKEY special parameters
may be entered, the /M Macro switch must be specified. Since DOSKEY
automatically displays its string on screen, the /Q switch is
permanently in effect. Note that DOSKEY does not append a carriage
return/line feed to its string. This must be provided, if desired, in
the batch file. This command requires DOS version 5.0 or higher.
DOSKEY has only one buffered input function besides its installation
check. When this function returns, an output buffer identical to that
required for DOS Interrupt 21H Function 0AH is filled with the user
input. If the user input a DOSKEY macro name or a string with special
DOSKEY parameters, this buffer is empty and the function must be
called again to obtain the expansion. This is what the /M Macro
switch checks for. One side effect of this check is that if a
carriage return is input on a blank line, DOSKEY returns the same
information when it signals a macro expansion is pending. Since CFG
cannot tell the difference between DOSKEY's output in these two
situations, the program is written to assume that a macro/special
parameter has been entered and loop back to retrieve the expansion of
the macro/special parameter. The result is that with /M specified, a
carriage return on a blank line will loop. At least one character
must be entered to break out of the loop.
If a macro expands to several commands (i.e. commands separated by the
"$t" special character), each must be removed individually from
DOSKEY's buffer. Assigning each to a unique EnVar will keep them
straight. Executing the EnVar will execute the command line as if it
had been typed from the DOS command line.
▒▒▒DOSlocation . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the location of the DOS kernel.
Command line format:
DOSlocation SubCommandName
The following are valid SubCommandNames: RAM, ROM, High, Low. Each
SubCommandName may be abbreviated as desired, but must be unique. The
return ErrorLevel is 1 if True and 0 if False.
▒▒▒DOSstartup . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the drive from which DOS was booted.
Command line format:
DOSstartup [/Q] [/@EnVar]
This command uses DOS Function 33H Subfunction 5 to determine the boot
drive. This command requires DOS version 4.0 or higher. If DOS is in
ROM, the command returns the drive CONFIG.SYS is on. The drive letter
is also written.
▒▒▒DOSversion . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the DOS version.
Command line format consists of only the CommandName. Valid
CommandNames are:
DOSmajor
DOSminor
DOSversion [/T]
For DOSminor, the return ErrorLevel is 10 for DOS 3.10, 31 for DOS
3.31, etc. For DOSversion, the return ErrorLevel is equal to
(32*major)+minor. Note that DOS 4.01 reports itself as 4.00. The /T
True Version switch executes the DOS 5.0+ Interrupt 21H Function 33H
Subfunction 06H. The regular DOS version function is used if this
call fails.
▒▒▒Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the current default drive.
Command line format:
Drive [/Q] [/@EnVar]
Exit ErrorLevels:
1 = A:, 2 = B:, etc.
The default drive is displayed.
▒▒▒DriveExist . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the requested drive letter is a valid DOS drive.
Command line format:
DriveExist d:
Exit ErrorLevels:
0 = Invalid
1 = Valid
where "d:" corresponds to the drive to be tested.
▒▒▒DriveID . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Identify the type of drive specified.
Command line format:
DriveID d: [/F|/P]
Exit ErrorLevels:
Physical drive ID:
0 = 320K/360K disk
1 = 1.2M disk
2 = 720K disk
3 = Single-density 8-inch disk
4 = Double-density 8-inch disk
5 = Fixed disk
6 = Tape drive
7 = 1.44M disk
8 = Read/write optical disk
9 = 2.88M disk
13 = RAM disk
14 = CD-ROM
15 = Unidentified
Drive type flags (added to above):
0 = Physical
16 = SUBST
32 = JOIN
64 = Remote
128 = Invalid
Other:
253 = /P specified on non-physical drive (no error message)
254 = Invalid drive designation
255 = Invalid DOS version
NOTE: Uses undocumented information.
This command identifies the type of drive specified on the command
line by examining the DOS Current Directory Structure. If the flags
identify the drive as a physical one, Interrupt 21H Function 44H
Subfunction 0DH is called to identify the drive type.
If the flags indicate a CD-ROM drive, the flag ErrorLevel is cleared
and the CD-ROM ErrorLevel is returned. If the drive is unidentified,
and the RamDrive command tests are satisfied, the flag ErrorLevel is
cleared and the RamDrive ErrorLevel is returned.
The /F Flags switch returns an ErrorLevel according to the drive type
flags. The /P Physical switch returns an ErrorLevel according to the
physical drive ID. The /F switch overrides the /P switch if both are
specified. With no switch specified, the drive type flag ErrorLevel
and physical drive ID ErrorLevels are additive.
NOTE: There are quite a number of possible return ErrorLevels
depending on exactly what drive you test. All ErrorLevels greater
than 127 indicate an invalid drive. This command requires DOS
version 5.0+.
▒▒▒DriveReady . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if a drive is ready for access.
Command line format:
DriveReady d:
Exit ErrorLevels:
0 = Drive not ready
1 = Drive ready
where "d:" corresponds to any single drive letter. The DriveExist
command is called first. The command then installs a replacement DOS
Critical Error Handler to trap the resultant error if the drive is not
ready when Interrupt 21H Function 1CH (Get Allocation Information for
Specific Drive) is executed.
▒▒▒DriveSize . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the size of the specified or default drive.
Command line format:
DriveSize [/Dn] [d:]
Exit ErrorLevels:
0 = Invalid drive error
1-255 = Blocks of space on the drive
where "d:" corresponds to the drive desired. If the drive is omitted,
the default drive is used. The command returns the number of full and
partial blocks on the drive. The default block size is 100 kilobytes.
A different block size may be specified with the /Dn switch. The /Dn
switch "n" value for this command is measured in kilobytes. If more
than 255 blocks are on the drive, the returned ErrorLevel will be 255.
▒▒▒DriveSpace . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the amount of free disk space on the specified or default
drive.
Command line format:
DriveSpace [/Dn] [d:]
Exit ErrorLevels:
0 = No blocks available or invalid drive error
1-255 = Blocks of space available
where "d:" corresponds to the drive desired. If the drive is omitted,
the default drive is used. The command returns the number of full
blocks available. Partial blocks are ignored. The default block size
is 100 kilobytes (102,400 bytes). A different block size may be
specified with the /Dn switch. The /Dn switch "n" value for this
command is measured in kilobytes. If more than 255 blocks are
available, the returned ErrorLevel will be 255.
▒▒▒DriveVolume . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if a particular disk volume exists on the named drive.
Command line format:
DriveVolume [d:]VolumeName
Exit ErrorLevels:
0 = Volume does not exist
1 = Volume exists
▒▒▒DS4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if a Toshiba portable computer is installed in a DeskStation
IV desk top unit.
Command line format:
DS4
Exit ErrorLevels:
0 = Not installed
1 = Installed
NOTE: Uses undocumented information.
▒▒▒Echo . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Send a comment line to the screen.
Command line format:
Echo [/C|/N] [String]
The /C switch is used to output a carriage return only at the end of
the String, returning the cursor to the first column for overwriting
the previous output. The /N switch is used to eliminate the final
carriage return/line feed, leaving the cursor at the end of the String
just displayed. /N takes precedence over /C if both are included.
The /Q switch has no affect on this command. Use Cecho to output text
in a specific color. Used without String, Echo outputs a carriage
return/line feed sequence.
Since DOS capitalizes everything in CONFIG.SYS during its parsing
scan, a carat [^] is used as the default character to toggle between
upper and lower case for the displayed string. If a carat is desired
on the displayed line, two carats [^^] should be used on the input
line. This format character is in effect only during execution from
CONFIG.SYS.
A tilde [~] is the default character for insertion of a carriage
return/line feed sequence in the displayed line. If a tilde is
desired on the displayed line, two tildes [~~] should be used on the
input line. This format character is in effect at all times.
If String is preceded by a double quote ["], the double quote is
deleted but leading separators are not removed.
Example command lines:
Echo S^tart ^DEVICE ^section...~
Echo " S^tart ^DEVICE ^section...~
The first command line would display "Start DEVICE section..." with
two trailing carriage return/line feeds. The second command line
would display " Start DEVICE section..." with two trailing
carriage return/line feeds.
▒▒▒EchoPause . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Suspend execution after printing a prompt message on the screen that
is specified on the command line.
Command line format:
EchoPause [/C|/N] [String]
Pressing any key resumes execution. See the Echo command for String
formatting and switches. Use KeyPause for optional pausing, Pause for
a standard pause message or WaitFor for timed pausing.
▒▒▒EGA25 . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 25 line color EGA screen.
Command line format:
EGA25 [/C]
Performs a mode 3 reset of the display adapter using Interrupt 10H
Function 0. This works on EGA in a display independent way. The /C
switch clears the screen after switching modes if ANSI is installed to
set the screen color.
▒▒▒EGA43 . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 43 line EGA screen.
Command line format:
EGA43 [/C]
Forces the use of the display adapter's internal 8x8 font. Interrupt
10H Function 11H Subfunction 12H performs an adapter mode reset when
it executes. This works on EGA in a display independent way. The /C
switch clears the screen after switching modes if ANSI is installed to
set the screen color.
This command is in effect only for video modes 0-3.
▒▒▒Env . . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine size and use of the DOS master environment and manipulate
environment strings.
Command line format:
Env SubCommandName [/Dn] [/1] [/2]
NOTE: Uses undocumented information. Environment variable names must
be in capital letters for the DOS SET command to use them.
This command performs several functions relating to the DOS
environment: It either returns information about the DOS environment
or it manipulates the strings in that environment. For information
SubCommands, results are returned via ErrorLevel. For string
SubCommands, CFG manipulates the environment of either the master
command processor (default, /1) or, the parent command processor (/2).
The following are valid SubCommandNames: Caps, Clear, Fill, Free,
Reset, Save, Set, Strings, Total, Used. Each SubCommandName may be
abbreviated as desired. The default block size for information
SubCommands is 16 bytes. A different block size may be specified with
the /Dn switch. The /Dn switch "n" value for this command is measured
in bytes. The /Dn switch has no meaning for string SubCommands. The
/2 switch will locate the environment of the parent program for
examination vice the master environment. If CFG is executed under a
secondary command processor, use of this switch will determine the
characteristics of the environment available to any other program
executed under that secondary command processor. It also provides an
alternate method of locating the master environment when CFG is
executed under the master command processor.
Caps: Capitalizes the names of all environment variables.
Clear: Removes *all* strings from the environment. Use with EXTREME
CAUTION.
Fill: Creates a series of environment strings named "CFGxxx" that
completely use all available environment space. "xxx" is a decimal
number that ranges from 001 to as high as required. This ensures that
any spawned command processors are created with an environment that
has the same size as the parent command processor. Deleting these
strings (either with the Reset SubCommand or multiple DOS SET
commands) frees the environment space. Each string uses a maximum of
80 bytes.
Free: Reports the number of blocks of space available for use. This
is equal to Total minus Used.
Reset: Removes the strings created by the Fill SubCommand. These
strings may also be removed using DOS SET commands. This command may
take several seconds on very large environments. This command
searches for the CFG001 variable and deletes all further sequential
variables it finds.
Save [FileName]: Copies the strings from the designated environment
preceded by "@SET " or "SET ", as appropriate. If the optional
FileName is present, the strings are written to it. Otherwise, they
are written to DOS StdOut. Only one environment (/1 or /2) should be
specified.
Set /@EnVar String: The /@EnVar switch is required. The String which
follows is placed in the environment. Environment variables in String
are not processed by CFG, but by DOS prior to passing the command line
to CFG. If String is preceded by a double quote ["], the double quote
is deleted but leading separators are not removed.
Strings: Reports the number of strings currently defined in the
environment. This option has a unchangeable /Dn switch value of 1.
Total: Reports the number of blocks of space in the environment.
Because of the way DOS allocates memory, the size in bytes will always
be a multiple of 16.
Used: Reports the total number of blocks of space currently in use.
This will be dependent on the number and length of existing
environment variables. This value includes the null bytes that
terminate each string.
▒▒▒ErrorLevel . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return a DOS ErrorLevel equal to the number on the command line.
Command line format:
ErrorLevel n
where "n" is a number between 0 and 255. Numbers greater than 255
return 255. Non-numbers return 0.
▒▒▒FileDir ▒▒▒FileDrive ▒▒▒FileExt ▒▒▒FileName . . . . . . . . [BATCH]
Returns the requested portion of the given file name string.
Command line format:
FileDir Filename [/Q] [/@EnVar]
FileDrive Filename [/Q] [/@EnVar]
FileExt Filename [/Q] [/@EnVar]
FileName Filename [/Q] [/@EnVar]
FileDir, FileDrive, FileExt and FileName are a group of related
commands that separate out portions of a supplied file name string.
This is best shown by example. Suppose CFG.COM exists in the current
directory of C:\CFG. The above commands will return the following
values given a command line of "CFG CommandName CFG.COM":
FileDir \CFG
FileDrive C:
FileExt COM
FileName CFG
CFG uses DOS Interrupt 21H Function 60H to canonicalize the supplied
path. FileDir is almost the same as the Dir command except that you
can specify other than the current directory, if desired.
▒▒▒FileDTC . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Compare the date and time stamps of two files.
Command line format:
FileDTC [d:][path]File1 [d:][path]File2
Exit ErrorLevels:
0 = Command line error
1 = File1 is older than File2
2 = (Date1 = Date2) and (Time1 = Time2)
3 = File2 DOS error on opening
4 = File1 DOS error on opening
5 = (Date1 = Date2) but Time2 is older than Time1
6 = Date2 is older than Date1
FileDTC (File Date Time Compare) compares the date and time stamps of
two files. FileDTC does not accept wildcards in the file names. An
ErrorLevel of 4 or higher indicates that File2 either does not exist
or is older than File1. An error message is displayed if either file
cannot be found.
FileDTC can be used as follows:
IfCopy.Bat
──────────
@Echo Off
If [%1]==[...] GoTo 1
If [%2]==[] GoTo End
For %%A In (%1) Do Call IfCopy ... %%A %2
GoTo End
:1
CFG FileDTC %2 %3%2
If ErrorLevel 4 GoTo End
Copy %2 %3%2 >Nul
:End
Issuing "IfCopy *.* A:" will copy all files from the current directory
to the A: drive that are older than those on the A: drive or do not
exist. This is a little more discriminating than Xcopy /d since it
also compares times.
▒▒▒FileExist . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the specified file exists.
Command line format:
FileExist [d:][path]FileName
Exit ErrorLevels:
0 = File does not exist
1 = File exists
This command is similar to the DOS "IF EXIST" batch file command.
▒▒▒FileLines . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the number of lines (records) in the specified file.
Command line format:
FileLines [d:][path]Filename [/Dn]
Exit ErrorLevels:
0 = Zero length file or file error
Else = Number of lines
This command counts the number of lines or records in an ASCII file by
searching for carriage return characters (ASCII 013). The last line
of a file will be counted even if it does not end in a carriage
return/line feed sequence. A line which ends a file and does end with
a carriage return/line feed will not count as an additional line.
This command has a /Dn block size of one, but I count using 32-bits
(just in case).
▒▒▒Files . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine size and use of the DOS System File Table.
Command line format:
Files SubCommandName
NOTE: Uses undocumented information.
This command returns information about the DOS System File Table (SFT)
that is created through the FILES command in CONFIG.SYS as well as
third party extenders. All information is returned via ErrorLevel.
The following are valid SubCommandNames: Blocks, Free, Margin,
Orphan, Previous, Total, Used. Each SubCommandName may be abbreviated
as desired. This command requires DOS 3.0+.
Blocks: Number of blocks the SFT is divided into. A large number of
blocks has little effect on performance, but may use up extra memory.
Free: Number of entries available for use. This is equal to Total
minus Used.
Margin: Minimum margin that existed at the "high water mark" of
previous use. This is equal to Total minus Previous. This value is
how close the system has gotten to a DOS file error due to no more
file handles being available.
Orphan: Number of entries that are orphaned, typically by redirecting
the output of a resident program to the NUL device during
installation. This number is a subset of the Used files.
Previous: Maximum number of files that had previously been open at any
one time since the computer was last booted. Since DOS reuses entries
after they have been closed, this value may be looked at as the "high
water mark" of SFT use.
Total: All entries available in the SFT, including any that may have
been created by later programs such as Qemm's FILES or PC Magazine's
UMBFILES.
Used: Number of entries currently in use. Typically, this will be 3
unless files have been orphaned or Windows is running.
▒▒▒FileSize . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the size of the specified file.
Command line format:
FileSize [/Dn] [d:][path]Filename
Exit ErrorLevels:
0 = File error
1-255 = Blocks of the file
The command returns the number of full and partial blocks in the file.
The default block size is 1024 bytes (1 kilobyte). A different block size may be specified with the /Dn switch. The /Dn switch "n" value
for this command is measured in bytes. If more than 255 blocks are in
the file, the returned ErrorLevel will be 255. An error message is
displayed if the file cannot be found.
▒▒▒FileText . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the Text string exists in the specified file.
Command line format:
FileText [d:][path]Filename [/C] "String"
Exit ErrorLevels:
0 = String not present
1 = String present
This command performs a case sensitive search of the designated file
for the text string. If the /C Case switch is used, a case
insensitive search is performed. An error message is displayed if the
file cannot be found.
▒▒▒GamePort . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if a game port is installed.
Command line format:
GamePort [/Q]
Exit ErrorLevels:
0 = Game port not installed
1 = Game port installed
A message is displayed with the results.
▒▒▒GetKey . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Get any keyboard input or limit the allowed keys to those specified on
the command line.
Command line format:
GetKey [/C] [/F] [/S] ["String"] [Al] [Cl] [D[:]t,p] [E] [Fn]
[Sn] [m]
Exit ErrorLevels:
With list = Position of key n lit (1, 2, 3, etc.)
Without list = Scan code of key pressed
255 = Ctrl-Break/Ctrl-C pressed (if not specified)
where:
/C - Comparison of characters in "String" is case sensitive.
/F - Flushes the keyboard buffer prior to execution.
/S - Causes the key pressed to be shown on screen.
These options may be placed in any order after the CommandName:
"String" is a series of characters representing valid keyboard
input.
String must be enclosed in either single or double quotes.
"Al" and "Cl" are Alt-letter and Ctrl-letter combinations.
"D:t,p" represents a delay time "t" and default key position "p"
to return if no choice is made after "t" seconds. "t" can be
between 1 and 3640. "p" cannot exceed the length of the
provided list plus one.
The "list plus one" option allows the detection of no choice.
"E" is the Escape key.
"Fn" are function keys F1 through F12. F0 represents the Return
or Enter key. Multiple function keys must be separated.
"Sn" adds (shifts) "n" to the returned ErrorLevel. This allows
testing of multi-layered menus in one pass. The maximum
value is 254. This option may be placed anywhere after the
CommandName.
"m" is direct keyboard scan codes.
There may be multiple occurrences of "String" on the input line. The
number of input keys is only limited by DOS command line length.
Used without options, GetKey returns the scan code of the key that was
pressed. GetKey's optional key list provides much greater
functionality. If you supply the optional "String" or other arguments
to GetKey, CFG will wait either until one of those keys listed has
been pressed or until you break out of the command with Ctrl-Break or
Ctrl-C. All other keypresses are ignored. A time limit may be
specified using the "D:t,p" option. If no "p" option is specified, 1
is used. By default, the GetKey command is not case sensitive (i.e.
if either "Y" or "y" is pressed, the ErrorLevel will be the same)
unless the /C switch is used. If you want the single quote included
as a valid keypress, enclose it in double quotes and vice versa.
Standard separators between the listed keys are parsed out.
Example command line:
GetKey "yn" F1 F2 F0 AC CC E "abc"
If F1 is now pressed, the returned ErrorLevel will be 3, since F1 is
the third entry in the list. Ctrl-C will return 7 in this case vice
255 since it is specified on the command line.
▒▒▒Help . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Display program scrollable help.
Command line format:
Help [String]
Without the optional String, this command is the same as using the /?
switch and displays the CFG.HLP file. With any String on the command
line, CFG.DOC is loaded and scanned (case insensitive) until String is
found preceded by "▒▒▒". Command headers are formatted thus.
CFG.DOC and CFG.HLP must be in the same directory as the CFG.COM in
order to be found. This command is not available in MultiCommand
mode.
▒▒▒IACAfill . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG]
Write up to 16 bytes to the Inter-Application Communication Area
(IACA) for communication between CONFIG.SYS and AUTOEXEC.BAT.
Command line format:
IACAfill String [/O]
There are 16 bytes at address 0040:00F0 called the IACA. These bytes
can be modified by any program, but few applications actually use them
since they are subject to change by any program and do not provide
much storage.
The IACAfill command moves the command line String to the IACA. The
String must be a single word. A space or carriage return will end the
transfer. The /O Overwrite switch will unconditionally overwrite
anything in the IACA. By default, IACAfill will not overwrite.
IACAfill fills the unused part of the IACA with ASCII zeroes.
IACAfill allows communication between CONFIG.SYS and AUTOEXEC.BAT on
pre-DOS 6.0 systems. When managing multiple configurations, this will
allow you to set a variable in each separate CONFIG.SYS file for
appropriate action in AUTOEXEC.BAT. Use the IACAread command to read
the string from the IACA.
Example command line:
IACAfill 386Max
This will store "386MAX" in the IACA.
▒▒▒IACAread . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Reads up to 16 bytes from the Inter-Application Communication Area.
Command line format:
IACAread [/Q] [/@EnVar] [/C] [String]
Exit ErrorLevels:
0 = No errors encountered
1 = No string present in the IACA
String may be any combination of characters that are desired to
precede the string read from the IACA. The /C switch causes the old
data to be cleared from the IACA. An error message will be displayed
if there is no string in the IACA.
IACAread first checks the IACA for a string. It then scans its
command line and writes anything it finds there and then writes the
IACA. The IACA is not cleared after reading unless the /C switch is
used.
Example command use:
CFG IACAread @SET EnVar=>%TEMP%\IACA.BAT
CALL %TEMP%\IACA.BAT
DEL %TEMP%\IACA.BAT
where EnVar is the name of the environment variable to be set. This
will write "@SET EnVar=String" to DOS StdOut. Using CFG's ability (as
of version 2.2) to write directly to the master environment, the above
can be shortened to:
CFG IACAread /Q /@EnVar
If the SET command in the example IACA.BAT file does not work, you
should have received an "Out of environment space" error from DOS
during execution. Check the free environment space using the Env Free
command. Environment space may be increased by placing a larger
number after the /E: switch on the CONFIG.SYS SHELL line or adding
such a line with a /E: switch to the file if none exists and
rebooting. See the sample CONFIG.SYS file below.
▒▒▒Input . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Get a line of input.
Command line format:
Input [/Q] [/@EnVar]
This command uses DOS Interrupt 21H Function 0AH (Buffered Input) to
get a string from the user. This string may be stored in the
environment using the /@EnVar switch. If /Q is used, the cursor
remains at the left most screen column. If /Q is not used, the cursor
is left at the end of the input line. The maximum length line
accepted is 254 characters.
▒▒▒Intense . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Enable intense background colors.
Command line format:
Intense
Interrupt 10H Function 10H Subfunction 3 is used to enable intense
background colors on EGA and above. Any blinking characters will stop
blinking and have intense backgrounds.
▒▒▒KeyBoard . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if an enhanced or standard keyboard is installed.
Command line format:
KeyBoard
Exit ErrorLevels:
0 = Standard keyboard is installed
1 = Enhanced keyboard is installed
This command checks the keyboard status byte at 0040:0096 to see if
bit 4 is set. If it is, an enhanced keyboard is assumed to be
attached to the system.
▒▒▒KeyBuffer . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Adjust the DOS default keyboard buffer between 2 and 16 characters.
Command line format:
KeyBuffer SubCommandName
Exit ErrorLevels:
0 = Parsing error
Else = Number of bytes (with Set or Status)
Else = Number of blocks (with Status /Dn)
This command changes the size of the available DOS keyboard buffer.
The following are valid SubCommandNames: Set, Status. Each
SubCommandName may be abbreviated as desired.
Set n: Requires a value for the new size. Valid numbers for "n"
range between 2 and 16.
Status [/Dn]: Returns the current buffer size in blocks as an
ErrorLevel even if the buffer has been relocated. The default block
size is 1 byte. A different block size may be specified with the /Dn
switch. The /Dn switch "n" value for this command is measured in
bytes and has meaning only with this SubCommand.
An error is displayed if the keyboard buffer has been shifted from the
DOS default location. This command is intended for a young typist who
may improperly hit multiple keys to force an early keyboard buffer
full beep from the BIOS.
▒▒▒KeyFlush . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Flush any waiting keys from the keyboard buffer.
Command line format:
KeyFlush
This command checks for available keys and repeatedly reads the
keyboard until they are all cleared from the keyboard buffer.
▒▒▒KeyPause . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Suspend execution if any of the Shift, Alt or Ctrl keys are pressed.
Command line format:
KeyPause
Exit ErrorLevels:
0 = Pause not executed
1 = Pause executed
One of the shift keys must be held down before program execution.
Execution resumes once the key is released. Use EchoPause to display
a customized pause message, Pause for a standard pause message or
WaitFor for timed pausing.
▒▒▒KeyPress . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if there is a key waiting in the keyboard buffer.
Command line format:
KeyPress
Exit ErrorLevels:
0 = No keys available
1 = Keys are available
▒▒▒KeyStuff . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Place the command line characters into the BIOS keyboard buffer.
Command line format:
KeyStuff String
Exit ErrorLevels:
0 = No characters inserted
Else = Number of characters inserted
The characters appearing after the CommandName are placed in the
buffer. Leading spaces are parsed off. No maximum buffer length or
location is assumed. The command will place one less than the full
buffer of characters into the buffer, preventing CFG from interfering
with the BIOS buffer logic.
▒▒▒LastBoot . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine how the system was last booted.
Command line format:
LastBoot
Exit ErrorLevels:
0 = Cold boot (Flag value = 0000H)
1 = Warm boot (Flag value = Else)
2 = Warm boot (Flag value = 1200H)
3 = Warm boot (Flag value = 1234H)
The command examines the BIOS boot flag at 0040:0072 to determine the
method of the last system boot. A flag value of zero is assumed to be
a cold boot. The normal flag value for a warm boot is 1234H. Some
BIOS versions overwrite the lower byte of this with a zero, resulting
in a flag value of 1200H for a warm boot. Any other non-zero flag
value is also identified and assumed to be a warm boot.
▒▒▒LastDrive . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine letter of last available drive.
Command line format:
LastDrive [/Q] [/@EnVar]
Exit ErrorLevels:
0-255 = Drive number (A = 0)
NOTE: Uses undocumented information.
The lowest value this command can return is E:.
▒▒▒Left . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return the left most "n" characters from String.
Command line format:
Left n String [/Q] [/@EnVar] [/C]
where "n" is a decimal number indicating the number of characters to
return from String, counting from the left. The /C switch capitalizes
the returned string.
▒▒▒Length . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return the length of the input String.
Command line format:
Length String [/Q] [/@EnVar]
If String is preceded by a double quote ["], the double quote is
deleted but leading separators are not removed.
▒▒▒Locate . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set cursor position on active video page.
Command line format:
Locate r c
Exit ErrorLevels:
0 = No errors
255 = Input parsing error
where "r" corresponds to the row number and "c" corresponds to the
column number. The top row is row 1. The furthest left column is
column 1. Decimal numbers are required.
▒▒▒Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Locks up the system after optionally displaying a fake error message.
Command line format:
Lock [SubCommandName] [/C]
CAUTION: This command requires a system reset after execution.
The following are valid SubCommandNames: Disk, Net, None, Stack,
System. Each SubCommandName may be abbreviated as desired. No actual
error occurs. The /C ColdBoot switch requires a hardware reset. This
command is Windows-aware if the /C switch is used.
Disk: Displays "Not ready reading drive C; Abort, Retry, Fail?".
Net: Displays "Error accessing network".
None: Displays nothing. Default if SubCommandName is omitted.
Stack: Displays "Internal stack overflow; System halted".
System: Displays "Internal error; System halted".
▒▒▒Lower . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return String all in lower case.
Command line format:
Lower String [/Q] [/@EnVar]
If String starts with a double quote ["], the double quote is deleted
but leading separators are not removed.
▒▒▒LptHide . . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG]
Hide and restore the printer port base addresses.
Command line format:
LptHide SubCommandName
The following are valid SubCommandNames: Hide, Restore. Each
SubCommandName may be abbreviated as desired. Error messages are
displayed if the routine fails.
LptHide hides the printer port base addresses by copying them to
another location in memory when the Hide command is used. On
restoration with the Restore command, LptHide verifies the signature
and checksum stored with the port addresses to ensure that they were
not accidently over-written during RCD.SYS execution. LptHide then
copies the base addresses back to their normal location.
Example command sequence:
CFG.COM LptHide Hide
RCD.SYS /M0
CFG.COM LptHide Restore
The specific program this was written for is the Iomega Bernoulli Box
RCD.SYS driver, though it may be useful at other times. During
RCD.SYS execution, it interrogates the printer ports to determine if
there are any parallel port Bernoulli Boxes installed. Unfortunately,
some printers respond to this interrogation by printing the
interrogation sequence.
The default location for the hidden data is 7000:0000 for DOS versions
before 5.0. This is below the 512 KB boundary in the event that the
machine only has that much base memory available, and high enough to
keep it from being over-written during execution of other device
drivers while the data is hidden. For DOS Version 5.0+, the location
will vary depending on what the SysInit loader module reports as the
maximum available memory in the device driver header. This prevents interference with the larger memory requirements in the upper areas
around the 640 KB point that can occur under DOS 6.0+ with large
multiple-configuration CONFIG.SYS files.
▒▒▒LptSet . . . . . . . . . . . . . . . . . . . . . . [BATCH/CONFIG]
Sets the parallel port base addresses to a default or specified value.
Command line format:
LptSet a [b]
Where "a" corresponds to the desired port base address to set: 1, 2 or
3. The "b" corresponds to an optional hexadecimal value to set the
port base address to. No checking is performed to warn of values
being overwritten. Use this command carefully.
This command places a default port base address value (or the
specified value) in the appropriate location in the low memory DOS
data area. The default values used for the ports are 3BCH, 378H and
278H. If your system uses different values, you must specify them as
"b" on the command line.
You can set multiple base addresses to the same value to access the
same physical port using different DOS port names. The IRQ associated
with a specific parallel port has no impact since they are generally
all the same.
▒▒▒LptSwap . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Swap the printer base port addresses for the two printer ports
specified.
Command line format:
LptSwap a b
where "a" and "b" are the numbers of the printer ports to be swapped.
Valid numbers are 1, 2 and 3. An error message will be given if one
of the ports is missing or invalid.
LptSwap switches the two ports as far as DOS is concerned. This is
useful if you need to shift the printer ports around and are loading a
software print buffer as a device driver. The contents of the port
addresses are not checked during the swap.
Example command line:
LptSwap 1 3
▒▒▒MachineName . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the network machine name.
Command line format:
MachineName [/Q] [/@EnVar]
This command will display a name only if network software is loaded.
This command requires DOS version 3.1 or higher.
▒▒▒Memory . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine amount of memory available.
Command line format:
Memory SubCommandName [k] [/Dn] [/Q] [/@EnVar]
Exit ErrorLevels:
With "k" specified
──────────────────
0 = Requested amount of memory is not available or format error
1 = Requested amount of memory is available
Without "k" specified
─────────────────────
0 = Requested memory is not available or format error
Other = Number of blocks of memory available
where "k" is the number of kilobytes required. Valid SubCommandNames
are: Base, Extended, Expanded, High, Main, UMB. Each SubCommandName
may be abbreviated as desired, but must be unique. A screen report is
made (unless /Q is used) and the exit ErrorLevel is set to the number
of blocks of available memory. The /Dn switch "n" value for this
command is measured in kilobytes. The /@EnVar switch will place the
total number of kilobytes in the desired environment variable. CFG
scans the command line for a decimal number after the SubCommandName.
This number is compared to the number of available kilobytes of the
requested type of memory.
Base Memory: CFG executes BIOS Interrupt 12H to get the among of
contiguous memory installed in the system. The default block size is
16 kilobytes.
Extended Memory: CFG checks for the presence of an XMS driver and
calls it if present. Interrupt 15H Function 88H is used otherwise.
The default block size is 64 kilobytes.
Expanded Memory: CFG checks for the presence of an EMS driver and
then executes Interrupt 67H Function 42H to get the number of free
expanded memory pages. The pages are converted to kilobytes for
reporting. The default block size is 64 kilobytes.
High Memory: Under DOS version 5.0 or higher, CFG uses Interrupt 2FH
Function 4AH Subfunction 01H to query free space in the High Memory
Area. The default block size is 1 kilobyte.
Main Memory: CFG calculates available memory based on the location of
its PSP and Interrupt 12H. The default block size is 16 kilobytes.
UMB Memory: Under DOS version 5.0 and higher, CFG attempts to link
the UMB chain with the low DOS memory chain to determine the largest
free available block. If this fails or an earlier DOS version is in
use, the XMS provider is queried, if present. The default block size
is 1 kilobyte.
Example command lines:
CFG Memory M 512 --- Test for 512 KB main memory
CFG Memory Exp 2048 --- Test for 2 MB expanded memory
CFG Memory Base /D64 --- Base memory in 64 KB blocks
▒▒▒Mid . . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return "n" characters from String starting at position "m".
Command line format:
Mid m n String [/Q] [/@EnVar] [/C]
where "m" and "n" are decimal numbers. "m" is the starting position
and "n" is the number of characters to return. The first letter of
String is position 1. If "m" is zero or past the end of String,
nothing is returned. "n" may extend past the end of the line without
an error. The /C switch capitalizes the returned string.
▒▒▒Mono . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 25 line monochrome screen.
Command line format:
Mono
Performs a mode 7 reset of the display adapter using Interrupt 10H
Function 0. This works in a display independent way. Use this
command only if a monochrome monitor is installed.
▒▒▒Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if a mouse is present and reset both software and hardware
for it.
Command line format:
Mouse
Exit ErrorLevels:
0 = Either hardware or driver are not installed
Else = Installed (number of buttons)
Performs an Interrupt 33H Function 0 reset to get the driver status.
This command requires DOS version 3.0 or higher.
▒▒▒Now . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Display the current date.
Command line format:
Now DateFormat [/Q] [/@EnVar]
where the DateFormat characters are given below. This format is an
extended version of that used in WordPerfect. Non-number characters
are transferred directly. The string is displayed using the current
colors.
Character Meaning
───────── ───────────────────────────────────────────────────────
1 Day of the Month
2 Month (number)
3 Month (word)
4 Year (all four digits)
5 Year (last two digits)
6 Day of the Week (word)
7 Hour (24-hour clock)
8 Hour (12-hour clock)
9 Minute
%$ ────┬ Used before a number will:
│ Pad numbers < 10 with a leading zero (%) or space ($).
└ Either will abbreviate the month or day of the week.
# ───── Used before a number will display that number.
&1 &2 &3 ─┬ Insert country specific string separators. See Country
&4 &5 &9 └ command for the string inserted.
Examples (USA):
3 1, 4 = December 25, 1984
%6 %3 1,4 = Tue Dec 25, 1984
%2/%1/5 (6) = 01/01/85 (Tuesday)
$2/$1/5 (%6) = 1/ 1/85 (Tue)
8&590 = 10:55am
If you desire to change the Day of Week and Month strings used in the
Now command to another language, you may do so by using DEBUG or a
disk editor and changing them manually. If you use DEBUG, rename the
CFG executable to CFG.XXX and load the file as normal. This is
required since CFG is now in EXE format. One caution: CFG expects
the strings to be terminated with an ASCII zero. Full length name
strings may be up to 15 characters long. Abbreviated name strings may
be up to 7 characters long. This will guarantee that the last
character is an ASCII zero. After exiting DEBUG, rename the CFG
executable to CFG.COM.
▒▒▒P5 . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Return information about the Intel Pentium processor.
Command line format:
P5 SubCommandName
The following are valid SubCommandNames: Model, Off, On, Step. Each
SubCommandName may be abbreviated as desired. An ErrorLevel of 0 is
returned on non-Pentium processors. Test for a Pentium using the CPU
command.
Model: Returns an ErrorLevel equal to the model number reported by
the Pentium processor using the CPUID instruction. I am not sure, but
I think Model=1 ==> P60/P66, Model=2 ==> P90, Model=3 ==> P100. I
have only been able to test on a P90.
Step: Returns an ErrorLevel equal to the stepping level reported by
the Pentium processor using the CPUID instruction.
Off/On: Disables or enables the Pentium FPU. This should be the
first DEVICE command in CONFIG.SYS.
▒▒▒Page . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Select/determine the active video display page.
Command line format:
Page [n]
where "n" corresponds to the desired video display page. If "n" is
omitted, no page change occurs. This command always returns an
ErrorLevel corresponding to the current display page. For modes 0 and
1, pages 0-7 are valid. For modes 2 and 3, pages 0-3 are valid. If
anything else is specified on the command line, no page change occurs.
Note that some programs write by default to page zero.
▒▒▒Pause . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Suspend execution after printing a prompt message on the screen.
Command line format:
Pause
Pressing any key resumes execution. The standard prompt is "CFG 2.41
Pause - Press any key to continue...". Use EchoPause to display a
customized pause message, KeyPause for optional pausing or WaitFor for
timed pausing.
▒▒▒Print . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if the DOS Print command has been installed.
Command line format:
Print
Exit ErrorLevels:
Else = Number of files in print queue
253 = Error in PRINT.COM
254 = Not installed, but not OK to install
255 = Not installed
This command requires DOS version 3.0 or higher.
▒▒▒PrintEcho . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Controls DOS print echo operation.
Command line format:
PrintEcho SubCommandName
Exit ErrorLevels:
0 = Disabled
1 = Enabled
NOTE: Uses undocumented information.
Valid SubCommandNames are: Off, On, Status, Toggle. Each
SubCommandName may be abbreviated as desired, but must be unique.
Off and On: Turn the DOS print echo function on and off by changing
its status byte in the DOS data area. A status message is provided
for each change in state.
Status: Reports the current DOS print echo state.
Toggle: Toggles the DOS print echo function from its previous state.
A status message is provided for the current state.
This command is available for MS-DOS Versions 3.1 through 6.22.
The DOS print echo function is toggled on and off using Ctrl-PrtScr or
Ctrl-P. If on, DOS will echo all characters displayed on the screen
using DOS functions to PRN (LPT1). Note that this function uses
undocumented information but has been tested for MS-DOS versions 3.1
through 6.22.
▒▒▒Printer . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the status of the printer.
Command line format:
Printer [n]
Exit ErrorLevels:
0 = Printer ready
1 = Printer time-out or device fault
2 = Out of paper
where "n" represents the printer number (1-3). If "n" is omitted or
is out of range, the PRN (LPT1) device is assumed. The ErrorLevels
are additive.
▒▒▒Protected . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if 80286+ processor is in protected mode.
Command line format:
Protected
Exit ErrorLevels:
0 = Real mode
1 = Protected mode
Calls the CPU command then determines if the processor protected mode
flag is set for 80286+ processors.
▒▒▒PrtScr . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Print the screen or controls print screen operation.
Command line format:
PrtScr SubCommandName [/F]
Exit ErrorLevels:
0 = Disabled
1 = Enabled
255 = Last print screen encountered error
Valid SubCommandNames are: Off, On, Print, Status, Toggle. Each
SubCommandName may be abbreviated as desired, but must be unique.
Off and On: Turn the BIOS interrupt function on and off by changing
its status byte in the BIOS data area. A status message is provided
for each change in state.
Print: Prints the current screen using BIOS Interrupt 5. A form feed
is appended if the /F Form Feed switch is used.
Status: Reports the current print screen interrupt status.
Toggle: Toggles the BIOS interrupt function from its previous state.
A status message is provided for the current state.
The BIOS bases its action on receipt of an Interrupt 5 Print Screen on
the status byte at 0040:0100. If the byte indicates that a print
screen is currently in progress, the BIOS aborts the new request.
This provides control of Interrupt 5 without a memory resident
program.
▒▒▒RamDrive . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Detect if the specified drive is a ramdrive or search for one.
Command line format:
RamDrive [/S] [d:] [/Q] [/@EnVar]
Exit ErrorLevels:
Without /S switch
─────────────────
0 = Drive is not a ramdrive
1 = Drive is a ramdrive
With /S switch
──────────────
0 = Ramdrive not found
Else = Ramdrive found (A:=1, B:=2, etc.)
This command has several variations. If "d:" is specified, that drive
is tested. If "d:" is omitted, the default drive is tested.
If the /S switch is specified, a search is performed for the first
ramdrive. If "d:" is also specified, the search starts with that
drive and moves up the drive letter chain. If "d:" is not specified,
the search starts with the D: drive. The search stops when the first
ramdrive is found or the first nonexistent drive letter is encountered. DriveExist is called to determine if a drive exists.
The ASCII drive specification is written to DOS StdOut only if the /S
switch is used. The /Q and /@EnVar switches are functional only when
/S is also used.
This command searches for a ramdrive in a manner that is independent
of finding a specific volume name which can be easily be changed.
Since there is no official way of detecting a ramdrive, this command
makes a determination by searching for three characteristic features:
The drive is non-removable, has only one FAT and has a cluster size of
one sector. If the first and at least one of the last two are true,
the drive is considered to be a ramdrive. The tests are not
completely foolproof. The following ramdrives have been tested to
date and are recognized as valid:
Microsoft Vdisk/RamDrive, Ziff-Davis XpanDisk, Qualitas 386disk,
PC-Kwik RamDrive.
Let me know of others which pass or fail the test.
Note that a ramdrive compressed with DoubleSpace, Stacker, SuperStor,
Squish or similar product is not recognized unless the uncompressed
drive is tested.
▒▒▒RandomFile . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Create a unique random file name in the specified directory.
Command line format:
RandomFile [d:][path] [/Q] [/@EnVar] [/S]
Exit ErrorLevels:
0 = Successful
1 = Invalid DOS version
2 = DOS Error: File not found
3 = DOS Error: Path not found
4 = DOS Error: Too many open files (no handles available)
5 = DOS Error: Access denied
6 = DOS Error: Invalid handle
This command creates a randomly named eight letter file name (with no
extension) in the specified directory (path) using DOS Interrupt 21H
Function 5AH. If a path is specified without a drive letter, the
default drive letter is added to the start of the path. If no path is
specified, the default drive and directory is used. The full path,
including "." and "..", is resolved using the Dir command. Note the
precautions given for this command above. The command normally
deletes the file upon completion. If the /S switch is specified, the
file is not deleted. This command requires DOS version 3.0 or higher.
The RandomFile command is useful for the creation of temporary files
that have a unique name. This guarantees that a filename conflict
will not occur.
▒▒▒Rem . . . . . . . . . . . . . . . . . . . . . . . . . . . [CONFIG]
Indicate the use of descriptive comments in the CONFIG.SYS file.
Command line format:
Rem [String]
This allows the entry of remarks in CONFIG.SYS for all DOS versions
without generating errors.
REM is implemented in DOS version 5.0+, but is not available in
earlier versions. For people who need to maintain standard machine
configurations, this can be an impediment to clear documentation.
While it slows CONFIG.SYS execution slightly, this is the best that
can be done (easily) for DOS versions prior to 5.0.
▒▒▒RenDir . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Rename a directory.
Command line format:
RenDir OldName NewName
Exit ErrorLevels:
0 = No errors
255 = DOS error or DOSmajor < 3
This command requires DOS version 3.0 or higher. Include the complete
path for both old and new directory names. The path is not required
if the directory being renamed is off the default directory. The DOS
functions used cannot rename the drive's current directory.
▒▒▒Right . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return the right most "n" characters from String.
Command line format:
Right n String [/Q] [/@EnVar] [/C]
where "n" is a decimal number indicating the number of characters to
return from String, counting from the right. The /C switch
capitalizes the returned string.
▒▒▒ROMdate . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Display the date of the ROM BIOS.
Command line format:
ROMdate [/Q] [/@EnVar]
The displayed date is the string of characters found at F000:FFF5 in
memory. Not all BIOS may have the date at this location.
▒▒▒ROMmodel . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Display the model bytes of the ROM BIOS.
Command line format:
ROMmodel [/Q] [/@EnVar]
The displayed bytes are in hexadecimal. If the system supports
Interrupt 15H Function C0H, then the model, submodel and BIOS revision
bytes of the ROM configuration table are displayed. If the system
does not support this call, the machine model byte at F000:FFFE is
displayed. The exit ErrorLevel is equal to the model byte.
▒▒▒RootDir . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the file capacity characteristics of the root directory.
Command line format:
RootDir SubCommandName d: [/Q] [/@EnVar]
where "d:" is the desired drive. The following are valid
SubCommandNames: Total, Free, Used. Each SubCommandName may be
abbreviated as desired. Error messages are displayed if the routine
fails. This command is useful to determine if a floppy root directory
has enough space to hold a specific number of file entries.
▒▒▒Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the number of displayed rows.
Command line format:
Rows
The returned level is based on the value stored in the BIOS data area.
▒▒▒Share . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if SHARE.EXE is installed.
Command line format:
Share
Exit ErrorLevels:
0 = Not installed, OK to install
1 = Not installed, not OK to install
2 = Installed
255 = Invalid DOS version
The command executes Interrupt 2FH Function 10H Subfunction 0. Note
that if DOS 4.01 SHARE was automatically loaded due to large disk
volumes, file sharing is in an inactive state until this call is made.
Share reports installed in a Windows DOS session with VSHARE.386
installed. This command requires DOS version 3.0 or higher.
▒▒▒Shift-AND . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if desired shift keys are depressed.
Command line format:
Shift-AND [Alt] [Ctrl] [Shift]
Exit ErrorLevels:
0 = Some or none of the keys listed are depressed
1 = All keys listed are depressed
The routine will work with either of the paired keys on the keyboard.
The requested keys are considered to be "AND"ed, meaning all keys
listed must be depressed. The arguments may be shortened as desired,
but must always be separated by at least one space. Use the Shift-OR
command to do an OR comparison of the shift keys. Use the ShiftState
command for identifying individual shift keys.
▒▒▒ShiftLock . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine status of keyboard NumLock, CapsLock, ScrollLock and Insert.
Command line format:
ShiftLock [SubCommandName]
Exit ErrorLevels:
With SubCommandName
───────────────────
0 = Lock state is off
1 = Lock state is on
Without SubCommandName
──────────────────────
0 = No lock states are on
1 = ScrollLock is on
2 = NumLock is on
4 = CapsLock is on
8 = Insert is on
The following are valid SubCommandNames: Caps, Insert, Num, Scroll.
Each SubCommandName may be abbreviated as desired.
Issued without a SubCommandName, the command returns the ErrorLevels
noted above. The ErrorLevel is additive and can be in the range of 0
to 15.
▒▒▒Shift-OR . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine if desired shift keys are depressed.
Command line format:
Shift-OR [Alt] [Ctrl] [Shift]
Exit ErrorLevels:
0 = None of the keys listed are depressed
1 = At least one of the keys listed is depressed
The routine will work with either of the paired keys on the keyboard.
The requested keys are considered to be "OR"ed, meaning at least one
of the keys listed must be depressed. The arguments may be shortened
as desired, but must always be separated by at least one space. Use
the Shift-AND command to do an AND comparison of the shift keys. Use
the ShiftState command for identifying individual shift keys.
▒▒▒ShiftState . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine which shift keys are depressed.
Command line format:
ShiftState
Exit ErrorLevels:
0 = None of the shift keys are depressed
1 = Right shift
2 = Left shift
4 = Right ctrl
8 = Left ctrl
16 = Right alt
32 = Left alt
The ErrorLevel is additive and can be in the range of 0 to 63. Use
the Shift-OR command to do an OR comparison of the shift keys. Use
the Shift-AND command to do an AND comparison of the shift keys.
▒▒▒Stacker . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Identify the presence of a Stacker device driver in memory and
optionally determine if a specific drive is a Stacker volume.
Command line format:
Stacker [d:]
Exit ErrorLevels:
Without argument:
0 = Not installed
Else = Installed [(32*major)+minor]
With argument:
0 = Not a Stacker volume
1 = Valid stacker volume
255 = Invalid drive letter
where "d:" represents an optional drive letter to be checked as being
a Stacker volume.
When run without command line arguments, a driver status message is
displayed. The version 2.01 driver will return an ErrorLevel of 65.
If any character is included on the command line, CFG checks to see if
it is a valid drive letter from A to Z. For legal drive letters, CFG
checks to see if that drive corresponds to a valid Stacker volume.
The appropriate message is displayed in each case. The drive does not
have to be a valid DOS drive to be checked. The Stacker device driver
consults an internal table to determine if the drive is a Stacker
volume. If a removable disk drive is checked (such as a floppy disk or a Bernoulli), the drive must be mounted in order to provide a valid
response. A reserved removable drive that does not have a volume
mounted will return an invalid response.
▒▒▒TaskSwitch . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine whether a task switcher is installed and enabled.
Command line format:
TaskSwitch [/Q] [/@EnVar]
Exit ErrorLevels:
0 = Not installed
1 = Installed (disabled)
2 = Installed (enabled)
Determines if any task switcher meeting the DOS 5.0 specification is
installed. If it is, the name of the task switcher is displayed.
▒▒▒Toggle . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Modifies the current shift state of the keyboard NumLock, CapsLock or
ScrollLock keys.
Command line format:
Toggle [N[+|-]] [C[+|-]] [S[+|-]] [/S]
where "N" represents the NumLock state, "C" represents the CapsLock
state and "S" represents the ScrollLock state. Toggle changes the
current shift state of the keyboard NumLock, CapsLock or ScrollLock
keys when used with just the letters. The state of the three keys is
explicitly turned on or off if the optional + or - argument is
supplied. The /S switch will write to the keyboard port to
synchronize the keyboard LEDs of systems that have a BIOS that does
not automatically perform the update.
▒▒▒Tones . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Programs the system's speaker port to emit a rising (Upward) or
falling (Downward) series of tones.
Command line format:
Tones SubCommandName
The following are valid SubCommandNames: Down, Up, Over, Under. Each
SubCommandName may be abbreviated as desired. Error messages are
displayed if the routine fails. Over calls Up then Down. Under calls
Down then Up.
▒▒▒Typematic . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set the keyboard typematic rate and delay.
Command line format:
Typematic [m,n|Fast]
Exit ErrorLevels:
0 = No errors
255 = Invalid value
where "m" corresponds to the typematic rate (1-32) and "n" corresponds
to the delay (1-4) in 1/4 second increments. For the rate, the larger
the number, the faster the rate. The Fast option is equivalent to
options of 32,1, setting the fastest repeat rate and shortest delay.
If no arguments are given, default values are used, equivalent to
options of 20,2. The values that the BIOS accepts are divisors that
cannot be easily translated into characters per second. The table
below lists some of the rate values and the equivalent number of
characters per second:
1 = 2.0 │ 12 = 5.0 │ 20 = 10.0 │ 28 = 20.0
6 = 3.0 │ 14 = 6.0 │ 22 = 12.0 │ 30 = 24.0
9 = 4.0 │ 17 = 8.0 │ 25 = 16.0 │ 32 = 30.0
▒▒▒Upper . . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return String all in upper case.
Command line format:
Upper String [/Q] [/@EnVar]
If String starts with a double quote ["], the double quote is deleted
but leading separators are removed.
▒▒▒Verify . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Return status of DOS Verify option.
Command line format:
Verify
Exit ErrorLevels:
0 = Off
1 = On
▒▒▒Version . . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine the version of various drivers/programs.
Command line format:
Version SubCommandName
Exit ErrorLevels:
0 = Not installed
Else = EMS/VCPI/XMS version [(16*major)+minor]
Else = DPMI version [(100*major)+minor]
Else = DOS version [(32*major)+minor]
Else = CFG version [(100*(major-2))+minor] <Ver 2.2 returns 20>
Valid SubCommandNames are: CFG, DOS, DPMI, EMS, VCPI, XMS. The DOS
SubCommand returns the same information as the DOSversion command,
including the /T switch.
DPMI - DOS Protected-Mode Interface
EMS - Expanded Memory Specification
VCPI - Virtual Control Program Interface
XMS - Extended Memory Specification
▒▒▒VGA25 . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 25 line VGA screen.
Command line format:
VGA25 [/C]
Forces the use of the display adapter's internal 8x16 font. Interrupt
10H Function 11H Subfunction 14H performs an adapter mode reset when
it executes. This works on VGA in a display independent way. The /C
switch clears the screen after switching modes if ANSI is installed to
set the screen color.
This command is in effect only for video modes 0-3.
▒▒▒VGA43 . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 43 line VGA screen.
Command line format:
VGA43 [/C]
Forces the use of the display adapter's internal 8x14 font. Interrupt
10H Function 11H Subfunction 11H performs an adapter mode reset when
it executes. This works on VGA in a display independent way. The /C
switch clears the screen after switching modes if ANSI is installed to
set the screen color.
This command is in effect only for video modes 0-3.
▒▒▒VGA50 . . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Set a 50 line VGA screen.
Command line format:
VGA50 [/C]
Forces the use of the display adapter's internal 8x8 font. Interrupt
10H Function 11H Subfunction 12H performs an adapter mode reset when
it executes. This works on VGA in a display independent way. The /C
switch clears the screen after switching modes if ANSI is installed to
set the screen color.
This command is in effect only for video modes 0-3.
▒▒▒VideoMode . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Determine/set the current video mode.
Command line format:
VideoMode [n]
If the optional hexadecimal number "n" is added, the designated video
mode is set. The returned ErrorLevel is based on the value stored in
the BIOS data area.
▒▒▒WaitFor . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Delay program execution for the number of minutes and seconds given on
the command line.
Command line format:
WaitFor [mm:]ss [/N]
Exit ErrorLevels:
0 = Timed out as requested
1 = Exited prior to time out due to key press
255 = Format error
where "mm" is the delay time in minutes and "ss" is in seconds. If a
single number is on the command line, it is assumed to be seconds.
The default is one second. The /N switch tells CFG to not flush the
keyboard buffer prior to executing the command.
CFG only checks for a ":" between the minutes and seconds. Any other
character or separator will cause the minutes value to be treated as
seconds and the seconds value to be ignored. Spaces should not be
used on either side of the colon.
Pressing any key during the wait period will cancel the wait. CFG
checks the keyboard buffer 18 times a second for a key press.
▒▒▒WaitTo . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Delay execution until the specified time of day.
Command line format:
WaitTo hh:mm[:ss] [/N]
Exit ErrorLevels:
0 = Timed out as requested
1 = Exited prior to time out due to key press
255 = Format error
where "hh" is the hour (0-23), "mm" is the minute (0-59) and "ss" is
the second (0-59). If the seconds are omitted, 0 is assumed. The /N
switch tells CFG to not flush the keyboard buffer prior to executing
the command.
Pressing any key during the wait period will cancel the wait. If a
key is waiting in the buffer and /N is not specified, the command
immediately ends.
▒▒▒WarmBoot . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Perform a keyboard (Ctrl-Alt-Delete) system reset.
Command line format:
WarmBoot SubCommandName [/V]
The following are valid SubCommandNames: WaitFor, WaitTo, Verify.
Each SubCommandName may be abbreviated as desired. Error messages are
displayed if the routine fails. All disk buffers that may not yet be
written are flushed to disk via Interrupt 21H Function 0DH (Disk
Reset) prior to system reset. For 8086/8088 processors only, the
command jumps to FFFF:0000 after clearing the warm boot flag in the
BIOS data area. For 80286+ processors, the system is reset via the
keyboard controller. The /V Verify switch is available for use with
the WaitFor and WaitTo subcommands.
WaitFor: Executes the WaitFor command first. All command line
options of the WaitFor command are available.
WaitTo: Executes the WaitTo command first. All command line options
of the WaitTo command are available.
Verify: Prompt before rebooting.
▒▒▒Window . . . . . . . . . . . . . . . . . . . . . . [CONFIG/BATCH]
Draw boxes on the screen in the desired color.
Command line format:
Window r c w h [b ["Fore [on] Back"]
where "r" is the top row of the box, "c" is the left column of the box
"w" is the box width, "h" is the box height and "b" is the box type
(0-2). The color must be enclosed by double quotation marks and
follows the same requirements as the Cls command. The top left screen
corner is 1 1.
Three box types are available. For b=0, the box is drawn without
borders. For b=1, the box has single-line borders. For b=2, the box
has double-line borders. If "b" is omitted, b=0 is assumed. A value
for "b" must be specified in order to include a color. If a color is
not specified, the current screen colors are used.
The smallest window allowed is 2 characters in width and height. The
area inside the border is blanked with spaces. Text can be added to
the frame using the Locate and Cecho commands.
▒▒▒Windows . . . . . . . . . . . . . . . . . . . . . . . . . . BATCH]
Determine if Microsoft Windows is currently running.
Command line format:
Windows
Exit ErrorLevels:
0 = Windows is not running
1 = Windows is running in either Real or Standard mode
2 = Windows is running in Enhanced mode
▒▒▒ZeroFile . . . . . . . . . . . . . . . . . . . . . . . . . [BATCH]
Creates or truncates a file to a length of zero.
Command line format:
ZeroFile [/T] Filename
Exit ErrorLevels:
0 = Successful (file did not previously exist)
1 = Successful (file existed and was truncated)
With error, ErrorLevel is the DOS error code (1-13)
This command will create a zero-byte file with the desired name. If
the file already exists, the /T Truncate switch must be specified for
CFG to truncate it. This command is useful to create zero-byte files
to serve as flags for batch files to store information without an
environment variable. A zero-byte file takes up no disk storage space
other than its directory entry.
Appendix A: Problems and Solutions
I pass multiple CFG commands to a batch file, but they do not execute
or cause an error.
This occurs when you use the MultiCommand separator with
replaceable DOS batch file parameters. DOS treats the
MultiCommand separator semicolon as white space and deletes it
while passing the parameter. This is what causes the errors.
The solution is to use the semicolon in the called batch file or
set up the CFG commands on separate lines.
Appendix B: Bibliography
Ralph Brown and Jim Kyle, _PC Interrupts_, Second Edition, Reading MA:
Addison-Wesley, 1994.
Geoff Chappell, _DOS Internals_, Reading MA: Addison-Wesley, 1993.
Ray Duncan (ed), _The MS-DOS Encyclopedia_, Redmond WA: Microsoft
Press, 1988 (out of print).
Frank Van Gilluwe, _Undocumented PC_, Reading MA: Addison-Wesley,
1994.
Microsoft Corporation, _Microsoft MS-DOS Programmer's Reference_,
Second Edition, Redmond WA: Microsoft Press, 1993.
Andrew Schulman, et al., _Undocumented DOS_, Second Edition, Reading
MA: Addison-Wesley, 1994.
There have been several other books I have use that have proved to be
valuable:
Ray Duncan, _Power Programming with Microsoft Macro Assembler_,
Redmond WA: Microsoft Press, 1992.
Harley Hahn, _Assembler Inside and Out_, Berkeley CA: McGraw-Hill,
1992.
Robert Hummel, _Assembly Language Lab Notes_, Emeryville CA: Ziff-
Davis Press, 1992.
Peter Norton and Richard Wilton, _The New Peter Norton Programmer's
Guide to the IBM PC & PS/2_, Second Edition, Redmond WA: Microsoft
Press, 1988 (out of print).
Marcus Johnson, _Assembly Language: For Real Programmers Only_, Carmel
IN: Sams Publishing, 1993.
Allen L. Wyatt, Sr., _Advanced Assembly Language_, Carmel IN: Que
Corporation, 1992.
With these, you too can write a program like CFG. Have fun.
Appendix C: Revision History
Version 1.0 --- 28 August 1992
* First public version. Supported Beep, Cls, ComHide, ComSwap,
Echo, EchoPause, EGA25, EGA43, KeyPause, LptHide, LptSwap, Mono,
Pause, Tones, VGA25, VGA43, VGA50 and WaitFor commands.
Version 1.1 --- 11 September 1992
* Revised command line parsing. Recognizes the plus sign, equals
sign and comma as separators.
* Revised the method for detecting ANSI. Previously, the ANSI
Device Status Report sequence was used. This proved unreliable
on some systems when StdIn did not reflect a valid Cursor
Position Report from ANSI. The new method uses cursor
positioning sequences.
* Revised and updated the documentation.
* Cls: Corrected a bug that caused bright colors to sometimes be
displayed in low intensity, removed a mismatch between the DOS
and ANSI color values, and added color parsing error messages.
* Tones: Corrected error which made the command unavailable.
* Added the Color, IACAfill and Rem commands as well as the
IACAread companion program.
Version 2.0 --- 1 January 1993
* Program is now dual mode with a .COM extension. The separate
IACAread program is no longer required since that command is
incorporated from the command line.
* Improved error handling and reporting.
* Deleted the plus sign from the list of separator characters.
* Revised, updated and reformatted the documentation.
* Beep: Optionally allows specification of frequency and length
of sound, with the ability to do multiple sounds from a single
command line.
* Cls: Sets the screen border color to that of the background and
restores the cursor to its previous size.
* EGA25, EGA43, VGA25, VGA43 and VGA50: These screen mode
commands now optionally issue a ANSI escape sequence to clear
the screen after the mode change to reset the screen color if
the /C switch is specified.
* KeyPause: Also sets an ErrorLevel.
* Added the AM, ANSI, ASCII, Blink, Border, Break, CanCopy, Cecho,
ColdBoot, Cols, Compare, CoProc, CPU, Cursor, Day, DESQview,
DirExist, Display, DOSmajor, DOSminor, DOSversion, Drive,
DriveExist, DriveReady, DriveSize, DriveSpace, EMSversion, Env,
FileDTC, FileExist, Files, FileSize, FileText, FullYear, GetKey,
Hour, IACAread, Intense, IsVol, Locate, Memory, Minute, Month,
Page, PM, Protected, PrtScr, RamDrive, RenDir, ROMdate,
ROMmodel, Rows, Second, Share, Shift-AND, ShiftLock, Shift-OR,
ShiftState, StacInst, Toggle, Typematic, Verify, VideoMode,
WaitTo, WarmBoot, WeekDay, Window and Year commands. (Whew!)
*** Mediterranean/Red Sea Deployment 1993 *** Versions 2.1 and 2.2
were written while deployed aboard USS Theodore Roosevelt (CVN 71)
during support missions for the United Nations sanctioned NATO
Operations Provide Promise and Deny Flight in Bosnia-Herzegovina and
Operation Sharp Guard in the Adriatic Sea. We also participated in
Operation Southern Watch (southern Iraq no-fly zone) from the Red Sea.
The deployment was 11 March to 8 September 1993.
Version 2.1 --- 12 May 1993
This version is released for Bantam Books "PC Magazine DOS Power
Tools 6.0" by Paul Somerson.
* Added extended ErrorLevel reporting via the /E+ switch. The
ErrorLevel which would be returned is now displayable from
CONFIG.SYS.
* The exit ErrorLevel is now automatically included as part of an
error message display.
* Invalid CommandNames and file names are now displayed for easier
identification.
* The Help system screen code was modified for VGA and monochrome
systems.
* ANSI: Corrected a bug which caused a false negative report if
the cursor was already in the home position. If ANSI is not
present, screen characters are now restored instead of erased.
These changes extend to all commands which test for/use ANSI.
* ColdBoot: Optionally prompts the user to verify the reboot if
the /V Verify switch is used.
* Cecho, Echo, EchoPause: Commands completely rewritten to
correct a parsing error that would not correctly handle a
carriage return/line feed sequence. The default tilde (~)
format character can now be used from a batch file.
* Env: Optionally finds the environment of the immediate parent
process if the /P Parent switch is specified.
* FileSize: Changed block calculation such that a partial block
is added to the total number of blocks vice being ignored.
* IACAfill: Unconditionally overwrites the IACA if the /O switch
is specified.
* IACAread: Optionally clears the IACA after reading if the /C
switch is specified. This was nonfunctional in version 2.0.
* RamDrive: The /A switch now writes the correct letter to
StdOut, provides the correct ErrorLevel and corrects a bug which
could hang the machine if an unoccupied removable drive was
encountered during a /S search.
* ROMdate: Displays all eight characters of the date for ROMs
that have nonstandard date formats.
* StacInst: Renamed "Stacker".
* WarmBoot: See ColdBoot changes above.
* WeekDay, Day, Month, Hour and Minute: All accept an optional
parameter for direct comparison with the normal output.
* Added the DS4, Help, Keyboard, KeyBuffer, LastDrive, RandomFile
and Windows commands.
Version 2.2 --- 10 November 1993
* Added the ability for the program to place its output directly
into the DOS master environment and to directly manipulate
environment strings. The /@EnVar switch must be specified. See
the individual commands to determine support for this switch.
* CommandName and SubCommandName parsing was completely rewritten
for ease in future expansion. SubCommandNames may now be
abbreviated to any number of characters. Invalid
SubCommandNames are displayed for easier identification.
* The /A ASCII output switch no longer has a global effect. All
screen output is displayed unless the /Q Quiet switch is used.
/Q has no effect on the Cecho, Echo and EchoPause commands.
* The /Dn Divisor switch is now effective for all commands that
return an ErrorLevel except for a few specific cases. The
default divisor is 1.
* The /, Comma switch adds commas every three places to displayed
numbers.
* Beep: Pressing any key while playing now ends the command.
Added the /N No-Flush switch.
* CoProc, CPU, Protected: Corrected a stack restoration problem
in the Intel code which could possibly lock up the machine.
* DOSversion: Added the /T True option. See Version command.
* DriveVolume: Corrected handling of volume names longer than
eight characters. It worked previously if the period was
manually inserted between characters eight and nine.
* EMSversion: Command deleted - added to Version command.
* Env: Added the Clear, Fill, Reset and Set string SubCommands.
* FileSize: Corrected block calculation for files larger than 64
KB.
* FullYear: Corrected calculation for years greater than 1999.
* GetKey: Corrected documentation to say function keys *must* be
preceded by an "F". Numbers without an "F" were interpreted as
scan codes (as intended); only the documentation was in error.
Added the Escape key and Ctrl-/Alt- letter key combinations to
the parse list, the /C Case sensitive switch, the /S Show
(display) switch, the "D:t,p" option and the "Sn" option.
Standard separators are now parsed out.
* IACAread: Rewritten to use standard program output routines.
* IsVol: Renamed "DriveVolume".
* Memory: Deleted the /R Report switch. A screen report is
always made unless /Q is used. Exit ErrorLevel is now based on
whether or not a decimal number is present after the
SubCommandName. Added the High and UMB SubCommands. Changed
the "Xpanded" SubCommandName to "Expanded". [Extensive rewrite]
* PrtScr: Added control and indication of the DOS print echo.
* RandomFile: Resolves "." and ".." using the Dir command.
* ShiftState: Corrected bug which made function inoperative.
* Tones: Added the Over and Under options. Made the tone length
processor speed independent.
* VGA25: Changed from issuing a mode 3 reset to using the display
adapter's internal 8x16 font.
* WaitFor: Checks the keyboard buffer for a key press each timer
tick vice once each second. Added the /N No-Flush switch.
* WaitTo: Added the /N No-Flush switch.
* Added the Boot, CodePage, Country, Device, Dir, DosKey, FileDir,
FileDrive, FileExt, FileName, Input, KeyStuff, LastBoot, Left,
Length, Lower, MachineName, Mid, Mouse, Now, Print, Printer,
Right, RootDir, TaskSwitch, Upper, Version and ZeroFile
commands.
Version 2.3 --- 1 May 1994
* CFG is now multi-segmented (an EXE hiding in the COM file) in
order to support further additions (and my sanity), using MASM
6.11 vice TASM 1.0.
* CFG now has a MultiCommand mode that allows multiple
CommandNames on a single command line. Each command must be
separated by a semi-colon.
* Switches are now not scanned within fully quoted text strings.
* Added the /@EnVar switch "=" option to capitalize the associated
EnVar.
* Added the /Bn switch to establish the desired number system base
to use for some commands.
* Added to the /E switch: "@" option to place the output
ErrorLevel in the "EL" environment variable, "!" option to
specify which of the possible ErrorLevels to return in
MultiCommand mode, "E" option to allow basic ErrorLevel display
when all those other options are used.
* Corrected a bug in the environment code if the low memory
COMMAND.COM stub had been moved to the UMB area by a memory
manager (like 386Max). [This was in the /1B search method.]
* Changed the default method for locating the master environment.
The /1 switch specifies the primary or master environment. The
/1A and /1B options control specific search methods. The /2
switch specifies the secondary or parent environment. The old
/P switch is still valid, but the /2 switch will ensure future
compatibility. See the DOS Environment section of the CFG.ADD
file for details.
* CFG will now update both the master and parent environments, if
desired. See the Switches section for details.
* Commas are now ignored while reading numbers on the command line
unless specified in the command description.
* ASCII: Added /Bn support.
* Beep: Changed argument format--tone and duration values are now
separated by spaces; argument pairs are now separated by commas.
This change is required for the multiple command format. The
strict "no spaces" format is no longer required. Added /Bn
support.
* Cecho: /B Blink switch changed to /K to support multiple number
bases.
* ColdBoot: Added the WaitFor, WaitTo and Verify subcommands.
* CoProc: Corrected error identifying an 80486DX as "not
installed". Added Pentium identification.
* CPU: Added Pentium identification.
* Device: Changed format of the command to eliminate the
confusing set of switches. New SubCommands are Exist, List and
Rename. The /N and /R switches have been deleted.
* Env: See environment changes above. Added the Caps subcommand.
* KeyPause: Corrected bug that would not return the desired
ErrorLevel.
* MachineName: Now correctly displays names with embedded spaces.
* Memory: Corrected error that made the desired memory comparison
inoperative. Added environment output and desired memory
comparison for all subcommands.
* Memory Main: Now bases calculation on location of CFG's PSP due
to the EXE format.
* Mouse: Changed ErrorLevel reporting. An error in the reference
I used led me astray.
* PrtScr: Added ErrorLevel reporting for previous system PrtScr
error.
* VideoMode: Added the option of setting the desired video mode.
* WarmBoot: See ColdBoot.
* Added the Add, And, Convert, Div, DOSlocation, DOSstartup,
ErrorLevel, Lock, Mod, Mul, Not, Or, Sub and Xor commands.
Version 2.31 --- 21 May 1994
* FileText: Corrected bug that always returned string not
present. Added the /C Case switch for case insensitive
searches.
Version 2.32 --- 1 July 1994
The Great Bug Hunt: Here is a whole bunch of stuff that I
should have found earlier. Version 2.30 had quite a number of
changes, perhaps too many. I can only say that I have a much
more systematic method of testing now.
* Added Internal Error checking. This should never happen, but it
allows things to end a little bit more gracefully.
* Corrected display of messages during the /1B environment search
error exit.
* Corrected failure to display "Out of Environment Space" error
message.
* Corrected documentation about missing VGA command. The command
is not yet included.
* Note 1: Corrected bugs in several commands which caused errors
if they were not the last command on a line in MultiCommand
mode.
* Note 2: Corrected bugs in several commands which always
returned strings capitalized.
* ColdBoot: Revised reboot method for 286+ processors. The
system is now reset via the keyboard controller.
* DriveExist: Note 1.
* DriveReady: Note 1.
* DriveVolume: Added testing for invalid drive designation.
* Env: Corrected bug which put the Fill subcommand into a loop
and disabled the Reset subcommand. Fixed Set command.
* FileDTC: Note 1.
* Left: Notes 1 and 2. Added the /C switch.
* Mid: Notes 1 and 2. Added the /C switch.
* Right: Note 2. Added the /C switch.
* Toggle: Corrected bug which incorrectly displayed lock status.
* WaitFor: Added ErrorLevel return.
* WarmBoot: See ColdBoot.
Version 2.4 --- 1 October 1994
This version is released for TAB Books "The Ultimate Batch File
Book" by Ronny Richardson (or whatever it finally gets called).
* CFG is now Shareware with a $25 registration fee. Please
support shareware.
* On-line Help now includes searchable access of the CFG.DOC file.
See the Help command above for details. Quick Help is now a
separate CFG.HLP file and includes a list of SubCommandNames.
This allows a smaller executable and faster loading, especially
when executed from CONFIG.SYS. Both files must be in the same
directory as the CFG executable to be found.
* The /P switch no longer specifies the secondary environment.
Use the /2 switch.
* Note 3: Added the /@EnVar switch function to the arithmetic
commands. The /Q Quiet switch is noted for completeness.
* Add: Note 3.
* And: Note 3.
* Cecho: Corrected batch capitalization problem.
* Div: Note 3.
* EGA43: Now generates an error if you try to switch the video
font size while in video mode 4 or above.
* Env: Added the Save SubCommand. Now handles full environments
better.
* Help: See above.
* KeyBuffer: Changed format of the command to standardize the
options. New SubCommands are Set and Status.
* LptSwap: Now swaps printer timeout values also.
* Mod: Note 3.
* Mul: Note 3.
* Not: Note 3.
* Or: Note 3.
* PrtScr: Changed format of the command to eliminate the
confusing set of options. New SubCommands are Off, On, Print,
Status and Toggle. Moved DOS print echo control to the
PrintEcho command.
* Sub: Note 3.
* VGA25, VGA43 and VGA50: See EGA43.
* Xor: Note 3.
* Added the ComBaud, ComSet, DriveID, FileLines, GamePort, LptSet
and PrintEcho commands.
Version 2.41 --- 24 December 1994
* Slightly revised documentation.
* CPU: Corrected display of Pentium processor stepping level,
model and family. Also see the new P5 command.
* Added the P5 command based on several requests.
Appendix D: Background Discussion
CFG started as a pure DOS device driver. As such, versions 1.0 and
1.1 provided functionality from CONFIG.SYS only. I experimented with
dual-mode programming to make version 2.0 provide a command line
interface from DOS, expanding the program's scope significantly.
Subsequent versions have expanded on both the CONFIG.SYS and command
line utility commands available.
Version 2.1 almost made it into Bantam's "DOS 6.0 Power Tools" except
for the delays in the mail brought about by my 1993 deployment (2.0
was shipped). Several people received it directly based on specific
requests. Version 2.2 was another significant expansion and
improvement.
Version 2.3 moved CFG into still another facet of executable programs
in that it became a multi-segmented EXE program. The transition took
a bit work (with some errors despite all my testing, sorry), but was
necessary since I had to allow for up to 32KB of DOS environment,
adequate stack space, program code and all data within 64KB. While
version 2.2 fits, it was obvious there was no more room for expansion.
Version 2.3 has lots of elbow room for continued expansion and
improvement. Modular programming helps the space cram. The COM
extension was retained for compatibility with CONFIG.SYS and batch
files already written. DOS identifies the program as an EXE and loads
it appropriately. (The 2.3x versions fix known bugs.)
Version 2.4 splits the program's Help files out to reduce the size of
the executable. This allows faster execution from CONFIG.SYS when DOS
has only one disk buffer available. Searchable access to CFG.DOC is
also provided. Both changes were something I was planning for awhile.
CFG has also become shareware with this version. Version 2.4 was
published in Tab Books "The Ultimate Batch File Book" by Ronny
Richardson.
Numerous utilities exist for use from the command line, but few were
available for use in CONFIG.SYS. I could find only a few specially
written drivers for pausing CONFIG.SYS. When I added Qualitas'
BlueMax 6.0 to my system, what was once a relatively short boot
process became quite a protracted affair. I wanted to organize
things, add color to the device driver installation phase, messages
(if necessary) and optional pauses. I foresaw my disk becoming
overrun by numerous small device drivers (more than it already was),
so I wrote the basic CFG shell handler and then started looking around
for useful utilities. Most of what is included was written by myself.
Other routines were adapted from published sources, many of those were
enhanced.
When CFG is executed from CONFIG.SYS as a device driver, it does not
remain resident in memory and may be run multiple times. CFG sets up
its own stack during execution to avoid overflowing the DOS stack.
The program then moves the command line from the system buffer to a
local buffer for parsing. Switches are parsed, the CommandName is
scanned and a SubCommandName checked, if appropriate, and the
appropriate command is executed. The command is responsible for any
additional command line parsing. Upon completion of the command, the
CFG command handler regains control and performs the final clean-up
processing required by DOS for termination.
Since I wanted to access many CFG routines from the DOS command line
or from a batch file, I rewrote CFG (as of version 2.0) to be dual
mode program: both device driver and command line utility. Not all
commands, however, are available in each mode. An error message will
be displayed if a command is requested when it cannot be run.For those who are interested, CFG will run the same command subroutine
code from both CONFIG.SYS and a batch file, only the program entry
point changes. Not many DOS functions are [officially] available
during device driver installation, since the program file fragments
that will become the operating system are still being assembled when
the drivers' initialization routines are run. DOS (Interrupt 21H)
functions that are [officially] available are: 01H-0CH (various
character and string input and output routines), 25H (Set Interrupt
Vector), 30H (Get MS-DOS Version Number), and 35H (Get Interrupt
Vector). All BIOS video and keyboard routines are available. Within
these limits, some very useful things can be done. If you bend these
limits, even more interesting things are possible.
General parsing routines allow any of the standard DOS separator
characters to be ignored. With the exception of the bright Cls colors
noted in the command description and a few other clearly identified
cases, the number of spaces between command line words does not
matter.
Appendix E: Error Messages
ANSI not installed.
─── Issued if CFG determines that the ANSI driver has not been
loaded into memory when required for a command.
Buffer shifted.
─── Issued if the DOS keyboard buffer has been moved from its
default location when KeyBuffer attempts to change its size.
Cannot display Help in graphics mode.
─── Issued if the video system is displaying graphics when Help is
requested.
Cannot find file: Filename.
─── Issued if the requested file cannot be located by the DOS file
system.
Cannot locate hidden ports.
─── Issued if the signature is missing from the upper memory hidden
storage location. This could be due to the area having been
over-written or due to a Restore being run without a preliminary
Hide operation.
Cannot swap the same port.
─── Issued if the ports requested are the same.
Command not available.
─── Issued if the command is not available in the current program
mode. Check the CFG.DOC file to see which commands are
available from CONFIG.SYS and which are available from batch
files.
DOS error.
─── Issued if DOS returns an error when attempting to perform a
requested function. ErrorLevel is usually the DOS error number.
Environment error.
─── Issued if CFG's environment scanning routine encounters an error
in processing the environment (scan past end). The DOS
environment is not changed if this error occurs.
File error.
─── Issued if DOS returns an error when attempting to perform file
operations. The ErrorLevel is usually the DOS error number.
File exists.
─── Issued if ZeroFile finds that the requested file already exists
without the /T option specified.
Hidden ports already present.
─── Issued if Hide is run twice in succession without a Restore in
between. A second Hide action is prevented since it would
permanently erase the base port addresses.
IACA already in use.
─── Issued if the first character of the IACA is not an ASCII 0,
indicating other information may have been placed in the IACA.
IACA is empty.
─── Issued if the first character of the IACA is an ASCII 0,
indicating that nothing has been written to the IACA.
Invalid checksum, ports not restored.
─── The checksum stored with the hidden ports shows that the data
has been changed since it was written, probably due to being
over-written.
Invalid color.
─── Issued if anything appears after the CommandName that cannot be
parsed as a screen color when one is required.
Invalid CommandName.
─── Issued if specified CommandName is incorrect or missing.
Invalid DOS version.
─── Issued if the command requires a specific minimum DOS version
that does not match the version currently running.
Invalid drive designation.
─── Issued if a valid drive character is not specified on the
command line.
Invalid format.
─── Issued if the command line format does not match that required
by the command.
Invalid number.
─── Issued if the command line input is not in the correct decimal
or hexadecimal format.
Invalid SubCommandName.
─── Issued if a SubCommandName is not correct. CFG checks for a
match between the first word after the CommandName and values in
an internal table of valid SubCommandNames for Commands that
have SubCommands. If a match is not found, this error is issued
and no program output is made.
Invalid video mode.
─── Issued if the you try to switch video font size while in
graphics mode.
Missing or incorrect command option.
─── Issued if the requested Command does not have a required option
specified.
Missing or invalid port.
─── Issued if only one port is given on the command line or if the
port requested is other than 1/2/3/4 for ComSwap or 1/2/3 for
LptSwap.
Out of environment space.
─── Issued if the desired output will cause the environment to
exceed its maximum size. The output is not made and the
environment is not corrupted. Delete unneeded environment
strings or reboot with a larger /E: option specified in
CONFIG.SYS on the SHELL line.
Unable to find DOS Environment.
─── Issued if CFG's internal search routine cannot find the DOS
master environment based on it validation criteria.
Unknown SFT format.
─── Issued if the Files command finds an unexpected System File
Table format when performing its verifications.
Wrong color format or spelling.
─── Issued if an illegal color is encountered while parsing. See
the Cls command for the exact spelling.
Appendix F: Sample CONFIG.SYS File
The following is a past copy of one my CONFIG.SYS files showing usage
of several of the commands as well as the MultiCommand format. Line
wrap is indicated by indentation. This file is from an IBM PS/2 Model
80 with Stacker Version 2.1.
Break=On
Buffers=10
Dos=High
FCBS=1
Files=8
LastDrive=G
Stacks=8,128
Shell=C:\Dos\Command.Com C:\Dos\ /E:800 /P /F
Device=C:\Dos\Start\Cfg.Com VGA50;Cls Bright White on Blue
Device=C:\BlueMax\BlueMax.Sys Pro=C:\BlueMax\BlueMax.Pro
Device=C:\Dos\Start\Cfg.Com Cursor Hide; KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=1184 PrgReg=4 FlexFrame
Prog=C:\Dos\Start\DASDDrvr.Sys
Device=C:\Norton\Ncache.Exe /Install /Ini=C:\Norton
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=37056 PrgReg=3 FlexFrame
Prog=C:\Dos\Start\Mouse.Sys Ser 2 S06 NB
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=5280 FlexFrame
Prog=C:\Dos\Start\Bridge_B.Drv /PS60:1B
Device=C:\Dos\Start\Cfg.Com LptHide Hide; KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=30880 PrgReg=3 FlexFrame
Prog=C:\Dos\Start\RCD.Sys /M0
Device=C:\Dos\Start\Cfg.Com LptHide Restore; KeyPause;Cls Bright White
on Blue
Device=C:\BlueMax\386Load.Sys Terse Size=6768 PrgReg=2 FlexFrame
Prog=C:\BlueMax\386Disk.Sys 1024 512 64 /XMS
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=9040 PrgReg=2 FlexFrame
Prog=C:\Dos\Start\ANSI.Sys
Device=C:\Dos\Start\Cfg.Com Color Bright White on Blue;KeyPause
Device=C:\Stacker\Screate.Sys F:
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=40907 PrgReg=3 FlexFrame
Prog=C:\Stacker\Stacker.Com D:\StacVol.Dsk @ F: /EMS /NB
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\Stacker\Sswap.Com D:\StacVol.Dsk
Device=C:\Dos\Start\Cfg.Com KeyPause
Device=C:\BlueMax\386Load.Sys Terse Size=62573 PrgReg=3 FlexFrame
Prog=C:\NAV\NAV_.Sys /W
Device=C:\Dos\Start\Cfg.Com KeyPause; VGA25 /C; Cursor 2 2
Index
Add 14 DriveExist 28
AM 24 DriveID 29
And 14 DriveReady 30
ANSI 15, 18, 19 DriveSize 30
ASCII 15 DriveSpace 30
Association of Shareware DriveVolume 31
Professionals 6 DS4 31
Beep 15 Echo 31
Bibliography 64 EchoPause 32
Blink 16 EGA25 32
Boot 16 EGA43 32
NoError 16 Env 32
Border 16 Caps 33
Break 16 Clear 33
CanCopy 17 Fill 33
Cecho 17 Free 33
Cls 17 Reset 33
CodePage 18 Save 33
ColdBoot 19 Set 33
Verify 19 Strings 33
WaitFor 19 Total 33
WaitTo 19 Used 34
Color 19 Environment
Colors 18 General Description 11
Cols 19 Switch 9
ComBaud 20 Error Messages 73
ComHide 20 ErrorLevel 34
Hide 20 FileDir 34
Restore 20 FileDrive 34
Command Line FileDTC 34
Case 11 FileExist 35
From CONFIG.SYS 11 FileExt 34
Switches 8 FileLines 35
Syntax 8 FileName 34
Compare 21 Files 36
ComSet 21 Blocks 36
ComSwap 21 Free 36
Convert 22 Margin 36
CoProc 22 Orphan 36
Country 22 Previous 36
CPU 23 Total 36
Cursor 23, 76 Used 36
Default 23 FileSize 36
Hide 23, 76 FileText 37
Restore 23 FullYear 24
Day 24 GamePort 37
DESQview 25 GetKey 37
Device 25 Global Switches 8
Exist 25 Help 38
List 25 Hour 24
Rename 25 IACAfill 39
Dir 26 IACAread 39
DirExist 26 Input 40
Display 26 Installation 7
Div 14 Intense 40
DosKey 27 KeyBoard 40
DOSlocation 27 KeyBuffer 41
DOSmajor 28 Set 41
DOSminor 28 Status 41
DOSstartup 28 KeyFlush 41
DOSversion 28 KeyPause 41, 76
Drive 28 KeyPress 42
KeyStuff 42 ROMmodel 54
LastBoot 42 RootDir 54
LastDrive 42 Rows 54
Left 43 Second 24
Length 43 Share 54
Locate 43 Shareware 5
Lock 43 Shift-AND 55
Disk 44 Shift-OR 55
Net 44 ShiftLock 55
None 44 Caps 55
Stack 44 Insert 55
System 44 Num 55
Lower 44 Scroll 55
LptHide 44 ShiftState 56
Hide 44, 76 Stacker 56
Restore 44, 76 Sub 14
LptSet 45 SWREG 6
LptSwap 45 TaskSwitch 57
MachineName 45 Toggle 57
Memory 46 Tones 57
Base 46 Typematic 58
Expanded 46 Upper 58
Extended 46 Verify 58
High 46 Version 59
Main 46 CFG 59
UMB 46 DOS 59
Mid 47 DPMI 59
Minute 24 EMS 59
Mod 14 VCPI 59
Mono 47 XMS 59
Month 24 VGA25 59, 76
Mouse 47 VGA43 59
Mul 14 VGA50 60
MultiCommand 9 VideoMode 60
Not 14 WaitFor 60
Now 47 WaitTo 61
Or 14 WarmBoot 61
P5 48 Verify 61
Model 48 WaitFor 61
Step 48 WaitTo 61
Page 49 WeekDay 24
Pause 49 Window 61
PM 24 Windows 62
Print 49 Xor 14
PrintEcho 49 Year 24
Off 50 ZeroFile 62
On 50
Status 50
Toggle 50
Printer 50
Protected 50
PrtScr 51
Off 51
On 51
Print 51
Status 51
Toggle 51
RamDrive 51
RandomFile 52
Registration 5, 6
Rem 53
RenDir 53
Revision History 65
Right 53
ROMdate 53